InstallMarvellQLogicFCPowerKit.psm1
#/************************************************************************ #* * #* NOTICE * #* * #* COPYRIGHT 2019-2024 Marvell Semiconductor, Inc * #* ALL RIGHTS RESERVED * #* * #* This computer program is CONFIDENTIAL and contains TRADE SECRETS of * #* Marvell Semiconductor, Inc. The receipt or possession of this * #* program does not convey any rights to reproduce or disclose its * #* contents, or to manufacture, use, or sell anything that it may * #* describe, in whole or in part, without the specific written consent * #* of Marvell Semiconductor, Inc. * #* Any reproduction of this program without the express written consent * #* of Marvell Semiconductor, Inc is a violation of the copyright laws * #* and may subject you to civil liability and criminal prosecution. * #* * #************************************************************************/ # Helper Functions Function Out-Log { # This function controls console output, displaying it only if the Verbose variable is set. # This function now has another parameter, Level. Commands that may output messages now have a level parameter set. Key is below. # Level = 0 - Completely silent except for success / failure messages. # Level = 1 - Default if $Script:verbose is not set, about 5 output messages per added appx. # Level = 2 - Level 1 + Appcmd output messages, Add-AppxPackage messages # Level = 3 - Level 2 + Registry, XML, enabling of features, WinRM, setx, IO, netsh, etc. Very verbose. Param ( [Parameter(Mandatory=$true)] [AllowNull()] $Data, [Parameter(Mandatory=$true)] [AllowNull()] $Level, [Parameter(Mandatory=$false)] [AllowNull()] $ForegroundColor, [Parameter(Mandatory=$false)] [AllowNull()] [Switch] $NoNewline ) if ($Script:Verbose -eq $null) { $Script:Verbose = 1 } if ($Data -eq $null) { return } $Data = ($Data | Out-String) $Data = $Data.Substring(0, $Data.Length - 2) # Remove extra `n from Out-String (only one) $Data = $Data.Replace('"', '`"') $expression = "Write-Host -Object `"$Data`"" if ($ForegroundColor -ne $null) { $expression += " -ForegroundColor $ForegroundColor" } if ($NoNewline) { $expression += " -NoNewline" } if ($Level -le $Script:verbose) { Invoke-Expression $expression } } Function Test-ExecutionPolicy { # This function checks to make sure the ExecutionPolicy is not Unrestricted and if it is, prompts the user to change it to either RemoteSigned or Bypass. # If the ExecutionPolicy is left at Unrestricted, the user will receive one prompt for every cmdlet each time they open a new PowerShell window. $currentExecutionPolicy = Get-ExecutionPolicy if ($currentExecutionPolicy -eq 'Unrestricted') { $title = 'Execution Policy Configuration' $message = "Your current execution policy is $currentExecutionPolicy. This policy causes PowerShell to prompt you every session for every cmdlet. Set the execution policy to RemoteSigned or Bypass to avoid this." $remoteSigned = New-Object System.Management.Automation.Host.ChoiceDescription '&RemoteSigned', ` 'Sets the execution policy to RemoteSigned.' $bypass = New-Object System.Management.Automation.Host.ChoiceDescription '&Bypass', ` 'Sets the execution policy to Bypass.' $ignoreAndContinue = New-Object System.Management.Automation.Host.ChoiceDescription '&Ignore and Continue', ` 'Does not change the execution policy.' $options = [System.Management.Automation.Host.ChoiceDescription[]]($remoteSigned, $bypass, $ignoreAndContinue) $tempResult = $host.ui.PromptForChoice($title, $message, $options, 0) if ($tempResult -eq 0) { $newExecutionPolicy = 'RemoteSigned' } if ($tempResult -eq 1) { $newExecutionPolicy = 'Bypass' } if ($tempResult -eq 2) { return } # If the user has set a CurrentUser sceope level ExecutionPolicy, then change this to RemoteSigned/Bypass as well. if ((Get-ExecutionPolicy -Scope CurrentUser) -ne 'Undefined') { Set-ExecutionPolicy -ExecutionPolicy $newExecutionPolicy -Scope CurrentUser -Force } Set-ExecutionPolicy -ExecutionPolicy $newExecutionPolicy -Scope LocalMachine -Force Out-Log -Data "ExecutionPolicy changed from $currentExecutionPolicy to $(Get-ExecutionPolicy)." -Level 0 } } Function Test-IfNano { # Check if OS is Nano or Non-Nano $envInfo = [Environment]::OSVersion.Version $envInfoCimInst = Get-CimInstance Win32_OperatingSystem return ( ($envInfo.Major -eq 10) -and ($envInfo.Minor -eq 0) -and ($envInfoCimInst.ProductType -eq 3) -and (($envInfoCimInst.OperatingSystemSKU -eq 143) -or ($envInfoCimInst.OperatingSystemSKU -eq 144) ) ) } Function Test-IfServerCore { # Check if OS is Server Core $regKey = 'hklm:/software/microsoft/windows nt/currentversion' return (Get-ItemProperty $regKey).InstallationType -eq 'Server Core' } Function Get-CmdletsAppxFileName { if ($Script:isNano) { return '.\MRVLFCProvider-WindowsServerNano.appx' } else { return '.\MRVLFCProvider-WindowsServer.appx' } } Function Add-ManyToRegistryWriteOver { # This function changes multiple registry values at once. # Path is the path to the registry key to change, e.g. "HKLM:\Software\Classes\CLSID\{A31B8A5E-8B6A-421C-8BB1-F85C9C34E659}\InprocServer32" # NameTypeValueArray is an array of arrays of size 3 containing Name, Type, and Value for the registry entry, e.g. # @( # @('(Default)', 'String', "C:\Program Files\WindowsApps\MRVLFCProvider_1.0.1.0_x64_NorthAmerica_yym61f5wjvd3m\MRVLFCProvider.dll"), # @('ThreadingModel', 'String', 'Free') # ) Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Path, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $NameTypeValueArray ) # if path doesn't exist, create it if (-not (Test-Path -LiteralPath $Path)) { Out-Log -Data (New-Item -Path $Path -Force 2>&1) -Level 3 } $arr = $NameTypeValueArray if ($arr[0] -isnot [System.Array]) { Out-Log -Data (New-ItemProperty -LiteralPath $Path -Name $arr[0] -Type $arr[1] -Value $arr[2] -Force 2>&1) -Level 3 return } foreach ($ntv in $arr) { Out-Log -Data (New-ItemProperty -LiteralPath $Path -Name $ntv[0] -Type $ntv[1] -Value $ntv[2] -Force 2>&1) -Level 3 } } Function Test-RegistryValue { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Path, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Value ) try { Out-Log -Data (Get-ItemProperty -Path $Path | Select-Object -ExpandProperty $Value -ErrorAction Stop 2>&1) -Level 3 return $true } catch { return $false } } Function ConvertFrom-SecureToPlain { Param( [Parameter(Mandatory=$true)] [System.Security.SecureString] $SecurePassword ) $passwordPointer = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecurePassword) $plainTextPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto($passwordPointer) [Runtime.InteropServices.Marshal]::ZeroFreeBSTR($passwordPointer) return $plainTextPassword } Function Convert-CredentialToHeaderAuthorizationString { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Credential ) return [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$($Credential.UserName)`:$(ConvertFrom-SecureToPlain -SecurePassword $Credential.Password)")) } Function Get-AppxPackageWrapper { # This function tries the Get-AppxPackage command several times before really failing. # This is necessary to prevent some intermittent issues with Get-AppxPackage. # This may no longer be necessary as it seems to only happen after an Add-AppxProvisionedPackage which is no longer used. Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $AppxName ) $numAttempts = 3 $numSecondsBetweenAttempts = 5 for ($i=0; $i -lt $numAttempts; $i++) { $appxPkg = Get-AppxPackage | Where-Object { $_.name -eq $AppxName } if ($appxPkg -ne $null) { return $appxPkg } Out-Log -Data ("Couldn't find Appx package. Trying again in $numSecondsBetweenAttempts seconds (attempt $($i+1) of $numAttempts) ...") -ForegroundColor DarkRed -Level 1 Start-Sleep -Seconds $numSecondsBetweenAttempts } Out-Log -Data 'Failed to find Appx package. Please try running this script again.' -ForegroundColor Red -Level 0 Exit } Function Invoke-IOWrapper { # This function tries the Expression several times before really failing. # This is necessary to prevent some intermittent issues with certain IO commands, especially Copy-Item. Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Expression, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] $SuccessMessage, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] $FailMessage ) $numAttempts = 5 $numSecondsBetweenAttempts = 1 $Expression += ' -ErrorAction Stop' for ($i=0; $i -lt $numAttempts; $i++) { try { Invoke-Expression $Expression if ($i -ne 0) { Out-Log -Data 'Success!' -ForegroundColor DarkGreen -Level 3 } Out-Log -Data $SuccessMessage -Level 1 return } catch { if ($i -ne 0) { Out-Log -Data 'Failed.' -ForegroundColor DarkRed -Level 3 } Out-Log -Data "$FailMessage Trying again in $numSecondsBetweenAttempts seconds (attempt $($i+1) of $numAttempts) ... " -ForegroundColor DarkRed -NoNewline -Level 3 Start-Sleep -Seconds $numSecondsBetweenAttempts $Global:err = $_ } } Out-Log -Data 'Failed.' -ForegroundColor DarkRed -Level 3 Out-Log -Data "$FailMessage Failed after $numAttempts attempts with $numSecondsBetweenAttempts second(s) between each attempt." -ForegroundColor Red -Level 0 Out-Log -Data "Failed to install MarvellQLogicFCPowerKit. Before installing MarvellQLogicFCPowerKit, uninstall the same, reboot the server and try installing again." -ForegroundColor Red -Level 0 Exit } # Prompts Function Set-WinRMConfigurationPrompt { if ($Script:isNano) { return $false } # Skip if Nano if ($ConfigureWinRM) { return $true } $title = 'WinRM Configuration' $message = 'Do you want to configure WinRM in order to connect to Linux machines remotely?' $yes = New-Object System.Management.Automation.Host.ChoiceDescription '&Yes', ` 'Configures WinRM to allow remote connections to Linux machines.' $no = New-Object System.Management.Automation.Host.ChoiceDescription '&No', ` 'Does not configure WinRM. Remote connection to Linux machines will not be possible.' $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no) $tempResult = $host.ui.PromptForChoice($title, $message, $options, 0) if ($tempResult -eq 0) { return $true } else { return $false } } Function Get-CredentialWrapper { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $AddAccountToIISResponse ) if (-not $AddAccountToIISResponse) { return $null } try { return Get-Credential -Message 'Enter the credentials for the account you would like to be added to IIS' -UserName $env:USERNAME } catch { Out-Log -Data 'No credentials supplied; no account will be added to IIS.' -Level 1 } } Function Install-PoshSSHModule { if ($Script:isNano) { return $false } # Skip if Nano if ($InstallPoshSSHModule) { return $true } $title = 'Install-Posh-SSH_Module' $message = 'Do you want to install Posh-SSH_Module in-order to manage [Linux and VMware_ESXi Remote Host Systems] or not ?' $yes = New-Object System.Management.Automation.Host.ChoiceDescription '&Yes', 'install Posh-SSH_Module.' $no = New-Object System.Management.Automation.Host.ChoiceDescription '&No', 'Does not install Posh-SSH_Module.' $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no) $tempResult = $host.ui.PromptForChoice($title, $message, $options, 0) if ($tempResult -eq 0) { return $true } else { return $false } } Function Install-RESTServerPrompt { if ($Script:isNano) { return $false } # Skip if Nano if ($InstallRESTServer) { return $true } $title = 'Install-REST Server' $message = 'Do you want to install the REST server to be able to invoke FC PowerShell cmdlets via REST?' $yes = New-Object System.Management.Automation.Host.ChoiceDescription '&Yes', 'Installs the REST server.' $no = New-Object System.Management.Automation.Host.ChoiceDescription '&No', 'Does not install the REST server.' $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no) $tempResult = $host.ui.PromptForChoice($title, $message, $options, 0) if ($tempResult -eq 0) { return $true } else { return $false } } Function Get-RESTServerProtocolPrompt { $defaultValue = 'http' while ($true) { $response = Read-Host -Prompt "Would you like to use http or https? [$defaultValue] ?" if ([string]::IsNullOrWhiteSpace($response)) { return $defaultValue } elseif ($response -ne 'http' -and $response -ne 'https' -and $response -ne 'both') { Out-Log -Data "Response must be either: 'http' or 'https'; please try again.`n" -ForegroundColor Red -Level 0 } else { return $response } } } Function Get-RESTServerPortPrompt { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Protocol ) $defaultValue = '7777' if ($Protocol -eq 'https') { $defaultValue = '7778' } while ($true) { $response = Read-Host -Prompt "What $($Protocol.ToUpper()) port would you like to use for the REST server [$defaultValue] ?" if ([string]::IsNullOrWhiteSpace($response)) { return $defaultValue } $responseAsInt = $response -as [int] if ($responseAsInt -eq $null -or $responseAsInt -lt 1 -or $responseAsInt -gt 65535) { Out-Log -Data "Response must be a valid port number; please try again.`n" -ForegroundColor Red -Level 0 } else { return $response } } return $response } Function Get-RESTServerExistingHTTPSCert { $title = 'REST Server HTTPS Certificate Preference' $message = "Would you like to create a self-signed HTTPS certificate?`nSelecting no will allow you to choose the location of your existing HTTPS certificate." $yes = New-Object System.Management.Automation.Host.ChoiceDescription '&Yes', 'Creates a self-signed HTTPS certificate.' $no = New-Object System.Management.Automation.Host.ChoiceDescription '&No', 'Opens file selection dialog for location of existing HTTPS certificate.' $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no) while ($true) { $tempResult = $host.ui.PromptForChoice($title, $message, $options, 0) if ($tempResult -eq 0) { return $null # create self-signed cert } $fileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ Title = 'Select HTTPS certificate to use for the REST server' InitialDirectory = (Get-Location).Path Filter = 'Certificate File (*.pfx)|*.pfx' Multiselect = $false } $null = $fileBrowser.ShowDialog() if (-not [string]::IsNullOrWhiteSpace($fileBrowser.FileName)) { return $fileBrowser.FileName } } } Function Get-RESTServerHTTPSCertPasswordPrompt { while ($true) { $password1 = Read-Host -AsSecureString 'Please enter a password for the HTTPS certificate' $password2 = Read-Host -AsSecureString 'Please re-enter the password for the HTTPS certificate' $password1Text = ConvertFrom-SecureToPlain -SecurePassword $password1 $password2Text = ConvertFrom-SecureToPlain -SecurePassword $password2 if ([string]::IsNullOrWhiteSpace($password1Text) -or [string]::IsNullOrWhiteSpace($password2Text)) { Out-Log -Data "One or both passwords are empty; please try again.`n" -ForegroundColor Red -Level 0 } elseif ($password1Text -ne $password2Text) { Out-Log -Data "Passwords do not match; please try again.`n" -ForegroundColor Red -Level 0 } else { return $password1 } } } Function Get-RESTServerHTTPSCertPasswordPromptSimple { $password = Read-Host -AsSecureString 'Please enter the password for the HTTPS certificate' return $password } Function Test-HTTPSCertPassword { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $CertificateFilePath, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $SecurePassword ) $passwordText = ConvertFrom-SecureToPlain -SecurePassword $SecurePassword $null = certutil.exe -p $passwordText -dump $CertificateFilePath 2>&1 return $LASTEXITCODE -eq 0 } Function Test-LastExitCode { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $ExitCode, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Message, [Parameter(Mandatory=$false)] [AllowNull()] [Switch] $ExitScriptIfBadErrorCode ) if ($ExitCode -eq 0) { return; } if (-not $ExitScriptIfBadErrorCode) { Out-Log -Data "WARNING: $Message" -ForegroundColor Yellow -Level 1 } else { Out-Log -Data "ERROR: $Message" -ForegroundColor Red -Level 1 Exit } } # Main Functions Function Add-AppxTrustedAppsRegistryKey { # This function remembers user's current AllowAllTrustedApps registry setting and then changes it to # allow installation of all trusted apps. if ($Script:isNano) { return } # Skip if Nano if ($Script:isServerCore) { return } # Skip if Server Core # Remember user's registry setting before modify it to be able to set it back later. $appxPolicyRegKey = 'HKLM:\Software\Policies\Microsoft\Windows\Appx' $appxPolicyRegValName = 'AllowAllTrustedApps' if (Test-Path -Path $appxPolicyRegKey) { $appxPolicyRegValData = (Get-ItemProperty -Path $appxPolicyRegKey).$appxPolicyRegValName if ($appxPolicyRegValData -ne $null) { $Script:savedAppxPolicyRegValData = $appxPolicyRegValData } Start-Sleep -Milliseconds 1000 # Otherwise access denied error when do Add-ManyToRegistryWriteOver below } Add-ManyToRegistryWriteOver -Path $appxPolicyRegKey -NameTypeValueArray @( @($appxPolicyRegValName, 'DWord', 1) ) } Function Remove-CLSIDRegistryPaths { # if (-not $Script:isNano) { return } # Skip if NOT Nano if (Test-Path -Path "Registry::HKCR\CLSID\$Script:CLSID") { Remove-Item -Path "Registry::HKCR\CLSID\$Script:CLSID" -Recurse } if (Test-Path -Path "HKLM:\Software\Classes\CLSID\$Script:CLSID") { Remove-Item -Path "HKLM:\Software\Classes\CLSID\$Script:CLSID" -Recurse } } Function Install-ForServerCore { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $AppxFileName ) $serverCoreInstallPath = "$env:ProgramFiles\Marvell_Semiconductor_Inc\FC_PowerKit" $appxFileNameSimple = $AppxFileName.Replace('.\', '') $appxZipFileName = $appxFileNameSimple.Replace('.appx', '.zip') # Create installation directory if doesn't exist and copy Appx file to it (renamed to .zip) if (-not (Test-Path $serverCoreInstallPath)) { New-Item -Path $serverCoreInstallPath -Type Directory Copy-Item -Path $AppxFileName -Destination "$serverCoreInstallPath\$appxZipFileName" } # Unzip appx file to PowerKit directory Expand-Archive -Path "$serverCoreInstallPath\$appxZipFileName" -DestinationPath $serverCoreInstallPath # Register CIMProvider Register-CimProvider.exe -Namespace Root/qlgcfc -ProviderName MRVLFCProvider -Path "$serverCoreInstallPath\MRVLFCProvider.dll" -verbose -ForceUpdate -HostingModel LocalSystemHost } Function Add-AppxPackageWrapper { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $AppxFileName ) $savedProgressPreference = $Global:ProgressPreference $Global:ProgressPreference = 'SilentlyContinue' Out-Log -Data (Add-AppxPackage $AppxFileName 2>&1) -Level 2 $Global:ProgressPreference = $savedProgressPreference Out-Log -Data "Added '$($AppxFileName.Replace('.\', ''))' AppxPackage." -Level 1 } Function Add-CLSIDRegistryPathsAndMofCompInstall { # if ($Script:isNano) { return } # Skip if Nano # Perform steps of Register-CimProvider.exe -Namespace Root/qlgcfc -ProviderName MRVLFCProvider -Path MRVLFCProvider.dll -verbose -ForceUpdate -HostingModel LocalSystemHost $appxPath = (Get-AppxPackageWrapper -AppxName 'MRVLFCProvider').InstallLocation $mofcompOutput = & mofcomp.exe -N:root\qlgcfc $appxPath\MRVLFCProvider.mof 2>&1 if ($mofcompOutput -match 'Error') { Out-Log -Data "Failed to register '$appxPath\MRVLFCProvider.mof': $($mofcompOutput -match 'Error')" -ForegroundColor Red -Level 1 } Add-ManyToRegistryWriteOver -Path "HKLM:\Software\Classes\CLSID\$Script:CLSID" -NameTypeValueArray @( @('(Default)', 'String', 'MRVLFCProvider') ) Add-ManyToRegistryWriteOver -Path "HKLM:\Software\Classes\CLSID\$Script:CLSID\InprocServer32" -NameTypeValueArray @( @('(Default)', 'String', "$appxPath\MRVLFCProvider.dll"), @('ThreadingModel', 'String', 'Free') ) } Function Remove-AppxTrustedAppsRegistryKey { if ($Script:isNano) { return } # Skip if Nano if ($Script:isServerCore) { return } # Skip if Server Core $appxPolicyRegKey = 'HKLM:\Software\Policies\Microsoft\Windows\Appx' $appxPolicyRegValName = 'AllowAllTrustedApps' # If user previously had this registry key, set it back to what it was before. Otherwise, just delete the registry key. if ($Script:savedAppxPolicyRegValData -ne $null) { Add-ManyToRegistryWriteOver -Path $appxPolicyRegKey -NameTypeValueArray @( @($appxPolicyRegValName, 'DWord', $Script:savedAppxPolicyRegValData) ) } else { Remove-ItemProperty -Path $appxPolicyRegKey -Name $appxPolicyRegValName } } Function Copy-CmdletsToProgramData { # Check for ProgramData directories with old versions and remove them $oldPaths = (Get-ChildItem $env:ProgramData | Where-Object { ($_.Name).StartsWith('MRVLFCProvider_') }).FullName foreach ($oldPath in $oldPaths) { Remove-Item $oldPath -Recurse -Force 2>&1 | Out-Null } # Copy cmdlets to $appxPkg = Get-AppxPackageWrapper -AppxName 'MRVLFCProvider' $cmdletsPath = $appxPkg.InstallLocation + '\Cmdlets\' if (Test-Path $cmdletsPath) { $cmdletsDestPath = "C:\ProgramData\MarvellQLogicFCCmdlets" if (-not (Test-Path $cmdletsDestPath)) { Out-Log -Data (New-Item -ItemType Directory -Path $cmdletsDestPath -Force 2>&1) -Level 3 } Invoke-IOWrapper -Expression "Copy-Item -Path `"$cmdletsPath\*`" -Destination $cmdletsDestPath -Recurse -Force" ` -FailMessage "Failed to copy cmdlets." Import-Module -force $cmdletsDestPath\MarvellQLogicFCCmdlets.psd1 } } Function Copy-CmdletsToWindowsPowerShellModules { # Copy Cmdlets to "C:\Program Files\WindowsPowerShell\Modules" $appxPkg = Get-AppxPackageWrapper -AppxName 'MRVLFCProvider' $cmdletsPath = $appxPkg.InstallLocation + '\Cmdlets\' if (Test-Path $cmdletsPath) { $cmdletsDestPath = "C:\Program Files\WindowsPowerShell\Modules\MarvellQLogicFCCmdlets" if(-not (Test-Path $cmdletsDestPath)) { Out-Log -Data (New-Item -ItemType Directory -Path $cmdletsDestPath -Force 2>&1) -Level 3 } Write-Host $cmdletsPath Write-Host $cmdletsDestPath Invoke-IOWrapper -Expression "Copy-Item -Path `"$cmdletsPath\*`" -Destination `"$cmdletsDestPath\`" -Recurse -Force" ` -FailMessage "Failed to copy cmdlets." } } Function Copy-XMLTemplatesToProgramData { # Copy cmdlets to ProgramData $appxPkg = Get-AppxPackageWrapper -AppxName 'MRVLFCProvider' $xmlsTemplatesPath = $appxPkg.InstallLocation + '\Cmdlets\XML' if (Test-Path $xmlsTemplatesPath) { $xmlsTemplatesDestPath = "C:\Program Files\Marvell_Semiconductor_Inc\FC_PowerKit\XML" if (Test-Path $xmlsTemplatesDestPath){ Remove-Item $xmlsTemplatesDestPath -Recurse -Force } Invoke-IOWrapper -Expression "Copy-Item -Path `"$xmlsTemplatesPath`" -Destination `"$xmlsTemplatesDestPath`" -Recurse -Force" ` -SuccessMessage "XML Templates copied to '$xmlsTemplatesDestPath'." ` -FailMessage "Failed to copy XML Templates." } } Function Copy-DependentLibsAndFilesToWbemPath { $appxPkg = Get-AppxPackageWrapper -AppxName 'MRVLFCProvider' $dependentLibPath = $appxPkg.InstallLocation if (Test-Path $dependentLibPath) { $dependentLibDestPath = "C:\Windows\System32\wbem" # Copy ql2xhai2.dll to "C:\Windows\System32\wbem" Invoke-IOWrapper -Expression "Copy-Item -Path `"$dependentLibPath\ql2xhai2.dll`" -Destination `"$dependentLibDestPath`" -Recurse -Force" ` -SuccessMessage "Copied dependent library to Wbem path : '$dependentLibDestPath'." ` -FailMessage "Failed to copy dependent library : '$dependentLibDestPath'. Please uninstall the old version if present. Please stop 'WMI Provider Host' if running." # Copy adapters_adapter_provider.properties to "C:\Windows\System32\wbem" Invoke-IOWrapper -Expression "Copy-Item -Path `"$dependentLibPath\adapters_adapter_provider.properties`" -Destination `"$dependentLibDestPath`" -Recurse -Force" ` -SuccessMessage "Copied dependent file - adapters_adapter_provider.properties to Wbem path : '$dependentLibDestPath'." ` -FailMessage "Failed to copy dependent file - adapters_adapter_provider.properties : '$dependentLibDestPath'. Please uninstall the old version if present. Please stop 'WMI Provider Host' if running." # Copy adapters_cna_provider.properties to "C:\Windows\System32\wbem" Invoke-IOWrapper -Expression "Copy-Item -Path `"$dependentLibPath\adapters_cna_provider.properties`" -Destination `"$dependentLibDestPath`" -Recurse -Force" ` -SuccessMessage "Copied dependent file - adapters_cna_provider.properties to Wbem path : '$dependentLibDestPath'." ` -FailMessage "Failed to copy dependent file - adapters_cna_provider.properties : '$dependentLibDestPath'. Please uninstall the old version if present. Please stop 'WMI Provider Host' if running." # Copy nvramdefs to "C:\Windows\System32\wbem" Invoke-IOWrapper -Expression "Copy-Item -Path `"$dependentLibPath\nvramdefs`" -Destination `"$dependentLibDestPath\nvramdefs`" -Recurse -Force" ` -SuccessMessage "Copied dependent files - nvramdefs to Wbem path : '$dependentLibDestPath'." ` -FailMessage "Failed to copy dependent files - nvramdefs : '$dependentLibDestPath'. Please uninstall the old version if present. Please stop 'WMI Provider Host' if running." } } Function Add-ChangedCmdletsPathToPSModulePath { # This function adds cmdlet module path to system PSModulePath environment variable permanently. #$cmdletPath = "C:\Program Files\WindowsPowerShell\Modules\MarvellQLogicFCCmdlets" if ($Script:isServerCore) { $appxCmdletsPath = "$env:ProgramFiles\Marvell_Semiconductor_Inc\FC_PowerKit\Cmdlets" } else { $appxCmdletsPath = (Get-AppxPackageWrapper -AppxName 'MRVLFCProvider').InstallLocation + '\Cmdlets' } if (Test-RegistryValue -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Value 'PSModulePath') { $currPSModulePathArr = ((Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment').PSModulePath).Split(';') $newPSModulePathArr = @() # Remove any old paths with MRVLFCProvider from PSModulePath foreach ($path in $currPSModulePathArr) { if (-not $path.Contains('MRVLFCProvider')) { $newPSModulePathArr += $path } } # Add new cmdlet path to PSModulePath $newPSModulePathArr += $cmdletPath # Skip for uninstall script $newPSModulePathStr = $newPSModulePathArr -join ';' # Write PSModulePath to registry and set local session variable Out-Log -Data (& setx /s $env:COMPUTERNAME PSModulePath $newPSModulePathStr /m 2>&1) -Level 3 $env:PSModulePath = $newPSModulePathStr # Out-Log -Data "Added '$cmdletPath' to PSModulePath." -Level 1 } else { # No PSModulePath registry key/value exists, so don't worry about modifying it. Just create a new one. Out-Log -Data (& setx /s $env:COMPUTERNAME PSModulePath $cmdletPath /m 2>&1) -Level 3 $env:PSModulePath = $cmdletPath # Out-Log -Data "Added '$cmdletPath' to PSModulePath." -Level 1 } } Function Add-CmdletsPathToPSModulePath { # This function adds cmdlet module path to system PSModulePath environment variable permanently. if ($Script:isServerCore) { $appxCmdletsPath = "$env:ProgramFiles\Marvell_Semiconductor_Inc\FC_PowerKit\Cmdlets" } else { #$appxCmdletsPath = (Get-AppxPackageWrapper -AppxName 'MRVLFCProvider').InstallLocation + '\Cmdlets' #$appxPkg = Get-AppxPackageWrapper -AppxName 'MRVLFCProvider' #$appxCmdletsPath = "$env:ProgramData\$($appxPkg.PackageFullName)" $appxCmdletsPath = "C:\ProgramData\MarvellQLogicFCCmdlets" } if (Test-RegistryValue -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Value 'PSModulePath') { $currPSModulePathArr = ((Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment').PSModulePath).Split(';') $newPSModulePathArr = @() # Remove any old paths with MRVLFCProvider from PSModulePath foreach ($path in $currPSModulePathArr) { if (-not $path.Contains('MRVLFCProvider')) { $newPSModulePathArr += $path } } # Add new cmdlet path to PSModulePath $newPSModulePathArr += $appxCmdletsPath # Skip for uninstall script $newPSModulePathStr = $newPSModulePathArr -join ';' # Write PSModulePath to registry and set local session variable Out-Log -Data (& setx /s $env:COMPUTERNAME PSModulePath $newPSModulePathStr /m 2>&1) -Level 3 $env:PSModulePath = $newPSModulePathStr # Out-Log -Data "Added '$appxCmdletsPath' to PSModulePath." -Level 1 } else { # No PSModulePath registry key/value exists, so don't worry about modifying it. Just create a new one. Out-Log -Data (& setx /s $env:COMPUTERNAME PSModulePath $appxCmdletsPath /m 2>&1) -Level 3 $env:PSModulePath = $appxCmdletsPath # Out-Log -Data "Added '$appxCmdletsPath' to PSModulePath." -Level 1 } } Function Set-WinRMConfiguration { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $SetWinRMConfigurationResponse ) if ($SetWinRMConfigurationResponse) { Out-Log -Data (& winrm set winrm/config/client '@{AllowUnencrypted="true"}' 2>&1) -Level 3 Out-Log -Data (& winrm set winrm/config/client '@{TrustedHosts="*"}' 2>&1) -Level 3 Out-Log -Data 'WinRM successfully configured.' -Level 1 } } Function Test-PowerShellVersion { # This function tests the version of PowerShell / Windows Management Framework and prompts the user # to download a newer version if necessary. if ($PSVersionTable.PSVersion.Major -ge 4) { return } Out-Log -Data 'Failed to install FC REST API PowerKit: Windows Management Framework 4.0+ required.' -ForegroundColor Red -Level 0 Out-Log -Data ' Please install WMF 4.0 or higher and run this script again.' -ForegroundColor Red -Level 0 Out-Log -Data ' URL for WMF 4.0: https://www.microsoft.com/en-us/download/details.aspx?id=40855' -ForegroundColor Red -Level 0 Out-Log -Data ' URL for WMF 5.0: https://www.microsoft.com/en-us/download/details.aspx?id=50395' -ForegroundColor Red -NoNewline -Level 0 $title = 'Download Windows Management Framework 4.0+' $message = 'Windows Management Framework 4.0+ is required for FC REST API PowerKit. Which WMF version would you like to download?' $4 = New-Object System.Management.Automation.Host.ChoiceDescription '&4.0', ` 'Windows Management Framework 4.0 (https://www.microsoft.com/en-us/download/details.aspx?id=40855)' $5 = New-Object System.Management.Automation.Host.ChoiceDescription '&5.0', ` 'Windows Management Framework 5.0 (https://www.microsoft.com/en-us/download/details.aspx?id=50395)' $none = New-Object System.Management.Automation.Host.ChoiceDescription '&None', ` 'None' $options = [System.Management.Automation.Host.ChoiceDescription[]]($4, $5, $none) $tempResult = $host.ui.PromptForChoice($title, $message, $options, 1) if ($tempResult -eq 0) { Start-Process 'https://www.microsoft.com/en-us/download/details.aspx?id=40855' } elseif ($tempResult -eq 1) { Start-Process 'https://www.microsoft.com/en-us/download/details.aspx?id=50395' } # TODO - Add script exiting message. Exit } Function Test-RESTAPI { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Url, [Parameter(Mandatory=$false)] [AllowNull()] $EncodedAuthString ) try { if ($encodedAuthString -eq $null) { $response = (Invoke-RestMethod -Method Get -Uri $Url).value } else { $response = (Invoke-RestMethod -Method Get -Headers @{'Authorization' = "Basic $EncodedAuthString"} -Uri $Url).value } $response = ($response | Out-String).Trim() Out-Log -Data "`n$response`n" -Level 2 } catch { $Global:errRest = $_ Out-Log -Data "REST API test failed" -ForegroundColor Red -Level 0 Out-Log -Data " StatusCode: $($_.Exception.Response.StatusCode.value__)" -ForegroundColor Red -Level 0 Out-Log -Data " StatusDescription: $($_.Exception.Response.StatusDescription)" -ForegroundColor Red -Level 0 } } Function Import-AllCmdlets { # This function imports all QLGCFC cmdlets into the current PowerShell session. # This function is necessary to update any cmdlet and cmdlet help changes that have occurred from one PowerKit # version to another. One consequence of force importing the QLGCFC cmdlets is the user will be prompted if they # want to run software from an unpublished publisher when this function is called rather than the first time # intellisense is invoked after the PowerKit is installed. Note that this prompt only occurs if it is the user's # first time installing the PowerKit. Of course, in this scenario this function call is not necessary, since the # cmdlets will not need to be refreshed. # TODO - Determine if this is the first time PowerKit has been installed / if user already trusts QLGC publisher. #$moduleNames = (Get-Module -ListAvailable | Where-Object { $_.Name.StartsWith('QLGCFC_') }).Name #foreach ($moduleName in $moduleNames) #{ # try # { # Import-Module `"C:\Program Files\WindowsPowerShell\Modules\MarvellQLogicFCCmdlets\MarvellQLogicFCCmdlets.psd1`" -Force # #2>&1 | Out-Null # } # catch # { # # ignore any exception when importing. ErrorAction and 2>&1 | Out-Null in above command does not work! # # Out-Log -Data " Error occured while performing : Import-Module $moduleName -Force" -ForegroundColor Red -Level 0 # } #} } Function Install-FCPowerKit { Param ( $response0, $response1, $response2 ) # Encapulate installer logic here #-------------------------------------------------------------------------------------------------- # Globals $Script:CLSID = '{A31B8A5E-8B6A-421C-8BB1-F85C9C34E659}' $Script:savedAppxPolicyRegValData = $null $cmdletsAppxFileName = Get-CmdletsAppxFileName # $restAppxFileName = '.\MRVLFCProviderREST-WindowsServer.appx' $Script:appcmd = "$env:SystemRoot\system32\inetsrv\appcmd.exe" $Script:netsh = "$env:windir\system32\netsh.exe" $Script:Verbose = 1 #-------------------------------------------------------------------------------------------------- # User Input Test-ExecutionPolicy if ((Get-AppxPackage -Name 'MRVLFCProvider') -ne $null) { Test-LastExitCode -ExitCode 1 -Message "Could not install PowerKit because it is already installed! Please uninstall the PowerKit first." -ExitScriptIfBadErrorCode } else { $response0 = Set-WinRMConfigurationPrompt #$response1 = Install-PowerShellODataPrompt #$response2 = Add-AccountToIISPrompt -InstallPSODataResponse $response1 #$response0 = $WinRMConfiguration #$response1 = $Configure_IIS_OData_RESTAPI #$response2 = $AddAccountToIIS #$cred = $Credential #-------------------------------------------------------------------------------------------------- # Script - Cmdlets $Script:CurrentInstallation = 'MRVL FC PowerKit' Add-AppxTrustedAppsRegistryKey Remove-CLSIDRegistryPaths Add-AppxPackageWrapper -AppxFileName $cmdletsAppxFileName Add-CLSIDRegistryPathsAndMofCompInstall Remove-AppxTrustedAppsRegistryKey Copy-DependentLibsAndFilesToWbemPath Copy-CmdletsToProgramData Add-CmdletsPathToPSModulePath Set-WinRMConfiguration -SetWinRMConfigurationResponse $response0 Out-Log -Data "Successfully installed MarvellQLogicFCPowerKit.`n" -ForegroundColor Green -Level 0 #-------------------------------------------------------------------------------------------------- #Import-AllCmdlets Out-Log -Data "Note: if this was an upgrade from a previous version, you may need to restart the system for the new provider to be loaded." -ForegroundColor Yellow -Level 0 } } Export-ModuleMember -function Install-FCPowerKit # SIG # Begin signature block # MIIoogYJKoZIhvcNAQcCoIIokzCCKI8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0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