Microsoft Virtualization Discussions

why does this fail? get-ncsnapshot | Select-Object "xxx-vc1 tier 1_11-29-2020_18.40.00.0426"

moonman2013
1,671 Views

Hello,

Using powershell, I know how to copy/paste my snapshots to the clipboard

Get-NcVol dmz_vmware_t1_nfs11_dst | get-ncsnapshot | Select-Object Name | clip

 

Once I find the snapshot I want to delete it using powershell, but it fails

Get-NcVol dmz_vmware_t1_nfs11_dst | get-ncsnapshot | Select-Object "xxx-vc1 tier 1_11-29-2020_18.40.00.0426"| Remove-NcSnapshot

 

What am I doing wrong?

Should I do this instead?

Get-NcVol dmz_vmware_t1_nfs11_dst | get-ncsnapshot | | {$_.name -like "xxx-vc1 tier 1_11-29-2020_18.40.00.0426"} | remove-ncsnapshot -Confirm:$False

 

Thanks in advance

1 ACCEPTED SOLUTION

hmoubara
1,622 Views

Hello

 

You should be able to perform the command in deleting the snapshot by running the command as below:

 

>GET-NCVOL <vol name> |get-ncsnapshot | remove-ncsnapshot

 

The command will start asking you about each snapshot available and if you want to deleted or not.

If you already know the snapshot name you would run the below command:

 

>GET-NCVOL <vol name> |get-ncsnapshot | remove-ncsnapshot <volname> <snapshot name>

 

Thanks 

View solution in original post

1 REPLY 1

hmoubara
1,623 Views

Hello

 

You should be able to perform the command in deleting the snapshot by running the command as below:

 

>GET-NCVOL <vol name> |get-ncsnapshot | remove-ncsnapshot

 

The command will start asking you about each snapshot available and if you want to deleted or not.

If you already know the snapshot name you would run the below command:

 

>GET-NCVOL <vol name> |get-ncsnapshot | remove-ncsnapshot <volname> <snapshot name>

 

Thanks 

Public