InstallMarvellQLogicFCPowerKit.psm1
#/************************************************************************ #* * #* NOTICE * #* * #* COPYRIGHT 2019-2023 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 # MIIp0gYJKoZIhvcNAQcCoIIpwzCCKb8CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQ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