Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
Hi!
I have one Powershell code to delete old snapshots: Get-Navol | Get-NaSnapshot | where-object {$_.name -like "smo_*" -and $_.created -lt $3days} | Remove-NaSnapshot -Confirm
My storage is FAS8020 7-mode 8.2.2P2 and after upgrade the powershell toolkit to version 4.1 de .created object was dissapear.
Who can I do the same with the new version of Powershell or where can I download the old version of toolkit?
Best regards
Can you give any more details?
In particular, for the last two it would be helpful to know if they work separately...i.e. just use one at a time for the testing.
Andrew
This is the complete script
#Variable of date type which is 3 days before the current date
$3days = (get-date).adddays(-3)
#Get list of all snapshots older than 3 days and delete them
Get-Navol | Get-NaSnapshot | where-object {$_.name -like "smo_*" -and $_.created -lt $3days} | Remove-NaSnapshot -Confirm
It was working properly until the upgrade.
Thanks
Could you also tell us which version of Data ONTAP PowerShell Toolkit you were using before this?
I tried with the same scenario and was able to achieve the deletion of snapshots. I have tried with just 1 day earlier snapshots, as I dont have very old snapshots. Below are the images for reference.
#Variable of date type which is 1 day before the current date
$1day = (get-date).adddays(-1)
As seen in the images, the snapshots were deleted successfully.