Skip to content

Instantly share code, notes, and snippets.

@D4R4
Last active September 5, 2019 07:43
Show Gist options
  • Save D4R4/7ada05f3ea30cc361f30b4987875e209 to your computer and use it in GitHub Desktop.
Save D4R4/7ada05f3ea30cc361f30b4987875e209 to your computer and use it in GitHub Desktop.
This creates a backup from ESXi host configuration profile in tgz (?) format
$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
}
Get-VMHostFirmware -VMHost host.qqweasd -BackupConfiguration -DestinationPath c:\CLI
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment