Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Does anyone jnow how I can get the value for 'state' from the commandlet Get-NaSnapshotAutodelete?
With other commandlets i can just do this.
$Autogrow = Get-NaVolAutosize $volume.Name
$AutogrowOn = $Autogrow.IsEnabled.
I just want the value for 'state' (which is on or off). The output from the CLI is
PS > Get-NaSnapshotAutodelete $volume.Name
OptionName OptionValue
---------- -----------
state on
commitment try
trigger volume
target_free_space 20
delete_order oldest_first
defer_delete user_created
destroy_list none
Thanks
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You ever figure out how to get "state" value from snapshot autoddelete?
doug.clendening@chemailto:doug.clendening@chemailto:doug.clendening@chevron.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this:
get-nasnapshotautodelete $volume.name|%{$sadresult += @{$_."optionname"=$_."optionvalue"}}
Then your results will be in a hash called $sadresult so you can do
$sadresult.state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This will get the snapshot autodelete values for all volumes. This was bugging me for a while.
$volumes = Get-Navol
foreach ($volume in $volumes) {
$TheVolumeName = $volume.Name
$autodeletes = @(Get-nasnapshotautodelete $TheVolumeName | select OptionName, OptionValue)
write-host $TheVolumeName,"***"$autodeletes[0].optionvalue,"***"$autodeletes[1].optionvalue,"***"$autodeletes[2].optionvalue,"***"$autodeletes[3].optionvalue,"***"$autodeletes[4].optionvalue,"***"$autodeletes[5].optionvalue,"***"$autodeletes[6].optionvalue,"***"$autodeletes[7].optionvalue
}