![]() ![]() Out-CUConsole -Message 'The required VMWare PowerCLI components were not found as modules or snapins. $null = Import-Module -Name VMware.$component # Import each module, if Import-Module fails try Add-PSSnapin # Try Import-Module for each passed component, try Add-PSSnapin if this fails (only if -Prefix was not specified) Can be single or multiple values (as array).")] HelpMessage = "The VMware module to be loaded. Please make sure you have run the 'Create credentials for Horizon View scripts' script on the target machine." -Exception $_ Out-CUConsole -Message "The required PSCredential object could not be loaded. Import-Clixml -LiteralPath $strCUCredFolder\$($env:USERNAME)_$($System)_Cred.xml $strCUCredFolder = "$(::GetFolderPath('CommonApplicationData'))\ControlUp\ScriptSupport" HelpMessage = "The system the credentials will be used for.")] Out-CUConsole -Message "The script did not get enough arguments from the Console. # Check all the arguments have been passed # Not an exception or a warning, output the message # Write the warning to Warning stream, thats it. Write-Warning -Message "There was an error.`n$Message" Write-Warning "There was an unexpected error: $($)`nPlease see the Error tab for details." Write-Error "$Message`n$($)`n$($Exception.CategoryInfo)`n$($)" -ErrorAction Stop Write-Warning -Message "$Message`n$($)`nPlease see the Error tab for the exception details." # Write simplified error message to Warning stream, Throw exception with simplified message as well # Throw error, include $Exception details if they exist # Name of the Horizon View connection server. ![]() Copy Script Copied to clipboard $ErrorActionPreference = 'Stop' ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |