From 34b4dc853f18a8702d1b39c9cafb460c9c44c8da Mon Sep 17 00:00:00 2001 From: tunisiano187 Date: Fri, 29 Mar 2024 17:23:26 +0000 Subject: [PATCH] Package download hp-oa-cmdlets --- automatic/hp-oa-cmdlets/hp-oa-cmdlets.nuspec | 19 ++++++++++++ .../hp-oa-cmdlets/tools/chocolateyinstall.ps1 | 24 +++++++++++++++ .../tools/chocolateyuninstall.ps1 | 30 +++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 automatic/hp-oa-cmdlets/hp-oa-cmdlets.nuspec create mode 100644 automatic/hp-oa-cmdlets/tools/chocolateyinstall.ps1 create mode 100644 automatic/hp-oa-cmdlets/tools/chocolateyuninstall.ps1 diff --git a/automatic/hp-oa-cmdlets/hp-oa-cmdlets.nuspec b/automatic/hp-oa-cmdlets/hp-oa-cmdlets.nuspec new file mode 100644 index 000000000..265563e8c --- /dev/null +++ b/automatic/hp-oa-cmdlets/hp-oa-cmdlets.nuspec @@ -0,0 +1,19 @@ + + + + hp-oa-cmdlets + 1.1.0.701 + HP Onboard Administrator Cmdlets for Windows PowerShell + Hewlett Packard Enterprise + Sebastian Werner + http://www.hp.com/go/powershell + https://cdn.rawgit.com/fiveninezero/chocolatey-packages/master/icons/hp-oa-cmdlets.png + false + Scripting Tools for Windows PowerShell : OA Cmdlets create an interface to HPE Onboard Administrator(OA). These cmdlets can be used to get and set OA settings in HPE BladeSystem c3000 and c7000 Enclosures. + HP Onboard Administrator Cmdlets for Windows PowerShell + © 2015 Hewlett-Packard Development Company, L.P. + HP OA PowerShell admin + https://github.com/TheWeirdMachine/chocolatey-packages + http://h17007.www1.hp.com/us/en/enterprise/servers/solutions/info-library/index.aspx?cat=scripting_tools_powershell#.U6OAv3ZpdV0 + + \ No newline at end of file diff --git a/automatic/hp-oa-cmdlets/tools/chocolateyinstall.ps1 b/automatic/hp-oa-cmdlets/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..a7b561dd1 --- /dev/null +++ b/automatic/hp-oa-cmdlets/tools/chocolateyinstall.ps1 @@ -0,0 +1,24 @@ +$ErrorActionPreference = 'Stop'; # stop on all errors + +$packageName = 'hp-oa-cmdlets' +$url = 'https://downloads.hpe.com/pub/softlib2/software1/pubsw-windows/p157797746/v125056/HPOACmdlets-x86.exe' +$url64 = 'https://downloads.hpe.com/pub/softlib2/software1/pubsw-windows/p667675183/v125054/HPOACmdlets-x64.exe' +$checksum = 'FB9205CBB3477F3A0E9DBD56A7DAAE54A38ED84A52D80FEA5E44AD0BF105B56A' +$checksum64 = 'A66D300920464A8A7F9BF11E554E88C136180B28E66AF46F48674CFBB166AB81' +$checksumType = 'sha256' +$checksumType64 = 'sha256' +$fileType = 'msi' +$silentArgs = '/quiet' +$dlPkg = "$packageName" + ".exe" +$ValidExitCodes = '0' +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" + +if (Get-ProcessorBits 64) { + $file = "HPOACmdlets-x64.msi" +} else { + $file = "HPOACmdlets-x86.msi" +} + +Get-ChocolateyWebFile -PackageName $packageName -FileFullPath "$toolsDir\$dlPkg" -Url $url -Url64 $url64 -checksum $checksum -checksumType $checksumType -checksum64 $checksum64 -checksumType64 $checksumType64 +Get-ChocolateyUnzip -FileFullPath "$toolsDir\$dlPkg" -Destination $toolsDir +Install-ChocolateyInstallPackage $packageName $fileType $silentArgs "$toolsDir\$file" -ValidExitCodes $ValidExitCodes diff --git a/automatic/hp-oa-cmdlets/tools/chocolateyuninstall.ps1 b/automatic/hp-oa-cmdlets/tools/chocolateyuninstall.ps1 new file mode 100644 index 000000000..2f6e69c23 --- /dev/null +++ b/automatic/hp-oa-cmdlets/tools/chocolateyuninstall.ps1 @@ -0,0 +1,30 @@ +$ErrorActionPreference = 'Stop'; # stop on all errors + +$packageName = 'hp-oa-cmdlets' +$registryUninstallerKeyName = '{FEA3D3B6-EF5C-4287-A5F0-4A089970C52F}' #ensure this is the value in the registry +$msiProductCodeGuid = '{FEA3D3B6-EF5C-4287-A5F0-4A089970C52F}' +$shouldUninstall = $true + +$local_key = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\$registryUninstallerKeyName" +$local_key6432 = "HKCU:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$registryUninstallerKeyName" +$machine_key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$registryUninstallerKeyName" +$machine_key6432 = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$registryUninstallerKeyName" + +$file = @($local_key, $local_key6432, $machine_key, $machine_key6432) ` + | ?{ Test-Path $_ } ` + | Get-ItemProperty ` + | Select-Object -ExpandProperty UninstallString + +if ($file -eq $null -or $file -eq '') { + Write-Host "$packageName has already been uninstalled by other means." + $shouldUninstall = $false +} + +$installerType = 'MSI' +$silentArgs = "$msiProductCodeGuid /qn /norestart" +$validExitCodes = @(0, 3010, 1605, 1614, 1641) +$file = '' + +if ($shouldUninstall) { + Uninstall-ChocolateyPackage -PackageName $packageName -FileType $installerType -SilentArgs $silentArgs -validExitCodes $validExitCodes -File $file +} \ No newline at end of file