Page 1 of 1
Get "snapshotid" parameter via powershell
Posted: Tue Sep 01, 2015 9:17 am
by NikChallenger
Hello!
How can i get "snapshotid" parameter of an snapshot, to use it in “remove-snapshot” cmdlet?
Re: Get "snapshotid" parameter via powershell
Posted: Thu Sep 03, 2015 9:28 am
by Tarass (Staff)
You can find a lot of examples under "C:\Program Files\StarWind Software\StarWind\StarWindX\Samples\powershell". To get snapshots ID's use following routine:
Code: Select all
foreach($device in $server.Devices)
{
if ( $device.name -eq $deviceName)
{
if ( $device.IsSnapshotsSupported )
{
foreach($snapshot in $device.Snapshots)
{
Write-Host "Snapshot Id: $($snapshot.Id) Name: $($snapshot.name) Date: $($snapshot.Date)"
}
}
break;
}
}
Re: Get "snapshotid" parameter via powershell
Posted: Fri Sep 04, 2015 7:53 am
by NikChallenger
Tera, thank you very much!
Re: Get "snapshotid" parameter via powershell
Posted: Mon Sep 07, 2015 8:33 am
by Tarass (Staff)
You are welcome
