Skip to content

Instantly share code, notes, and snippets.

@D4R4
Last active September 5, 2019 07:43
Show Gist options
  • Save D4R4/a444ae1d4a0d660bbc713e61edc8c6db to your computer and use it in GitHub Desktop.
Save D4R4/a444ae1d4a0d660bbc713e61edc8c6db to your computer and use it in GitHub Desktop.
This restores a backup from an ESXi host configuration profile local folder
$VCUSER = "qweqwe" #$Parameters.Get_Item("VCUSER")
$VCPASS = "qweqwe"#$Parameters.Get_Item("VCPASS")
$VCNAME = "qweqwe" #$Parameters.Get_Item("VCNAME")
Describe "Checking PowerCLI Cmdlets available" {
$cmdletname = "Connect-VIServer"
It "Checking $cmdletname is available" {
$command = Get-Command $cmdletname
$command | Select Name, Version
$command.Name| Should Be $cmdletname
}
}
Describe "Connect-VIServer Tests" {
$connection = Connect-VIServer $VCName -User $VCUser -password $VCPass
It "Connection is active" {
$Global:DefaultVIServer[0].isconnected | Should Be $true
}
Set-VMHostFirmware -VMHost qweqwe -Restore -SourcePath c:\CLI\configBundle-qweqwe.ptco.net.tgz -HostUser root -HostPassword qweqwe
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment