adding verbose messages and removed quiet parameter
This commit is contained in:
@@ -19,7 +19,7 @@ foreach ($esxiHost in $esxiHosts) {
|
||||
#New-VICredentialStoreItem -host $esxiHost -user root -pass ((get-credential -Message $esxiHost -UserName root).GetNetworkCredential().password); continue
|
||||
|
||||
# Only move forward if host is online or else the rename will rename the host folder
|
||||
if (Test-Connection -Count 1 -Quiet $esxiHost) {
|
||||
if (Test-Connection -Count 1 $esxiHost) {
|
||||
# Backup folder for each host
|
||||
$backupFolder = "\\gauntnas.home.johnhgaunt.com\veeam$\ESXi Host Configurations\$esxiHost"
|
||||
|
||||
@@ -32,12 +32,14 @@ foreach ($esxiHost in $esxiHosts) {
|
||||
# Connect to the host
|
||||
Connect-VIServer -server $esxiHost `
|
||||
-user $credentials.user `
|
||||
-Password $credentials.password
|
||||
-Password $credentials.password `
|
||||
-verbose
|
||||
|
||||
# Backup the host configuration
|
||||
$filename = (Get-VMHostFirmware -vmhost $esxiHost `
|
||||
-BackupConfiguration `
|
||||
-destinationpath $backupFolder).Data.Name
|
||||
-destinationpath $backupFolder `
|
||||
-verbose).Data.Name
|
||||
|
||||
# Rename the backup file with the date
|
||||
Rename-Item "$backupFolder\$filename" "$backupFolder\$(get-date -UFormat %Y%m%d-%H%M%S) $filename" -verbose
|
||||
|
||||
Reference in New Issue
Block a user