VMware Cloud Community
michelvaillanco
Enthusiast
Enthusiast

script that will restore the network from the zip file

Hi,

I need help with a script that i build .

Get-VDSwitch -Name * | Get-VDPortgroup | Foreach {
Export-VDPortGroup -VDPortGroup $_ -Description “Backup of $($_.Name) PG” -Destination “C:\Backups\$($_.Name).Zip”
}

# This script will backup all of the VDSwitchs and there port group to a zip files.

I need a script that will restore the network from the zip files.


Regards,


Michel vaillancourt

Tags (1)
0 Kudos
3 Replies
LucD
Leadership
Leadership

Isn't that just calling the New-VDPortgroup cmdlet with the BackupPath parameter ?

Or did you already try that, and encountered issues ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
michelvaillanco
Enthusiast
Enthusiast

I have tried this:

Get-ChildItem “C:\Backups\PG” | Foreach {
New-VDPortgrouf3p -VDSwitch NewVDS -Name “New$($_.BaseName)” -BackupPath $_.FullName

}

and it created a new VDSwitch. i didn't try your solution? i will try it and ket you know.


Michel

0 Kudos
michelvaillanco
Enthusiast
Enthusiast

I tried it and it created a new VDPortgroup. I need it to restore the configuration to the same VDSwitch and VDPortgroup.

Michel

0 Kudos