1st, I'm a horrible scripter and admittedly know nothing but trying to use powershell more and more. However after a Cmode transistion I'm trying to clean up old snapshots. However some of the old snapshots for snapmirrors have (XX) in the name which is throwing an error in Powershell that as a newby I dont know how to fix after an hour of googling.
Help the noob? I know it has to do with the () however "" or '' doesnt tell it that it is a name.
I'm running:
Remove-NcSnapshot BLTEntVaultSrv01_Index GMDNASDRC7-VF0(2017635997)_BLTEntVaultSrv01_Index.2214 -VserverContext BLTNASPRD-SVM2 -confirm:$False
And I get back: Remove-NcSnapshot BLTEntVaultSrv01_Index GMDNASDRC7-VF0(2017635997)_BLTEntVaultSrv01_Index.2214 -VserverContext BLTNASPRD-SVM2 -confirm:$False
and I get back:
Remove-NcSnapshot : A positional parameter cannot be found that accepts argument '2017635997'.
At line:1 char:1
+ Remove-NcSnapshot BLTEntVaultSrv01_Index GMDNASDRC7-VF0(2017635997)_BLTEntVaultS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Remove-NcSnapshot], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,DataONTAP.C.PowerShell.SDK.Cmdlets.Snapshot.RemoveNcSnapshot
Help pretty please?