From b975af5926d4d835d8a2816d92dbe9c327a3120e Mon Sep 17 00:00:00 2001 From: Justin Dearing Date: Thu, 17 Jan 2013 05:50:56 -0500 Subject: [PATCH] feat: SQL2008R2.PowerShell 10.50.1600.0 - 10.50.1600.1 because zippy1981 bungled the pushed packages --- .../SQL2008R2.Powershell.nuspec | 28 +++++++++++++++++++ .../tools/chocolateyInstall.ps1 | 27 ++++++++++++++++++ .../tools/chocolateyUninstall.ps1 | 26 +++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 SQL2008R2.PowerShell/SQL2008R2.Powershell.nuspec create mode 100644 SQL2008R2.PowerShell/tools/chocolateyInstall.ps1 create mode 100644 SQL2008R2.PowerShell/tools/chocolateyUninstall.ps1 diff --git a/SQL2008R2.PowerShell/SQL2008R2.Powershell.nuspec b/SQL2008R2.PowerShell/SQL2008R2.Powershell.nuspec new file mode 100644 index 0000000..f3c26eb --- /dev/null +++ b/SQL2008R2.PowerShell/SQL2008R2.Powershell.nuspec @@ -0,0 +1,28 @@ + + + + SQL2008R2.PowerShell + Microsoft Windows PowerShell Extensions for SQL Server + 10.50.1600.1 + Microsoft + Ethan Brown, zippy1981 + Microsoft SQL Server 2008 R2 Feature Pack, October 2011 + + The Microsoft Windows PowerShell Extensions for SQL Server2008 R2 includes a provider and a set of cmdlets that enable administrators and developers to build PowerShell scripts for managing instances of SQL Server. The SQL Server PowerShell Provider delivers a simple mechanism for navigating SQL Server instances that is similar to file system paths. PowerShell scripts can then use the SQL Server Management Objects to administer the instances. The SQL Server cmdlets support operations such as executing Transact-SQL scripts or evaluating SQL Server policies. + The Microsoft Windows PowerShell Extensions for SQL Server2008 R2 includes a provider and a set of cmdlets that enable administrators and developers to build PowerShell scripts for managing instances of SQL Server. The SQL Server PowerShell Provider delivers a simple mechanism for navigating SQL Server instances that is similar to file system paths. PowerShell scripts can then use the SQL Server Management Objects to administer the instances. The SQL Server cmdlets support operations such as executing Transact-SQL scripts or evaluating SQL Server policies. + http://www.microsoft.com/en-us/download/details.aspx?id=3522 + SQL SQL2008R2 .NET CLR Powershell SMO + + false + https://github.com/Iristyle/ChocolateyPackages/raw/master/SQL2008.SMO/SQL2008.png + + + + + + + + + diff --git a/SQL2008R2.PowerShell/tools/chocolateyInstall.ps1 b/SQL2008R2.PowerShell/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000..92d50c4 --- /dev/null +++ b/SQL2008R2.PowerShell/tools/chocolateyInstall.ps1 @@ -0,0 +1,27 @@ +$package = 'SQL2008R2.PowerShell' + +try { + $params = @{ + packageName = $package; + fileType = 'msi'; + silentArgs = '/quiet'; + url = 'http://download.microsoft.com/download/B/6/3/B63CAC7F-44BB-41FA-92A3-CBF71360F022/1033/x86/PowerShellTools.msi'; + url64bit = 'http://download.microsoft.com/download/B/6/3/B63CAC7F-44BB-41FA-92A3-CBF71360F022/1033/x64/PowerShellTools.msi'; + } + + Install-ChocolateyPackage @params + + # install both x86 and x64 editions since x64 PS supports both + $IsSytem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and ` + ($Env:PROCESSOR_ARCHITEW6432 -eq $null)) + if (!$IsSytem32Bit) + { + $params.url64bit = $params.url + Install-ChocolateyPackage @params + } + + Write-ChocolateySuccess $package +} catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +} diff --git a/SQL2008R2.PowerShell/tools/chocolateyUninstall.ps1 b/SQL2008R2.PowerShell/tools/chocolateyUninstall.ps1 new file mode 100644 index 0000000..bd32ac3 --- /dev/null +++ b/SQL2008R2.PowerShell/tools/chocolateyUninstall.ps1 @@ -0,0 +1,26 @@ +# HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ +$msiId = '{8155DEBB-1BBC-4D15-A051-B3ADE07BF7B8}' +$msiId64 = '{DF5CF4FB-6D4E-4187-8456-06AC57E15214}' + +$package = 'SQL2008R2.PowerShell' + +$IsSystem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and ($Env:PROCESSOR_ARCHITEW6432 -eq $null)) + +try { + + $uninstallParams = @{ + PackageName = $package; + FileType = 'MSI'; + SilentArgs = "$msiId /qb"; + ValidExitCodes = @(0) + } + + if ($IsSystem32Bit) { $uninstallParams.SilentArgs = "$msiId64 /qb" } + + Uninstall-ChocolateyPackage + + Write-ChocolateySuccess $package +} catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +}