Hi All,
I am trying this code to bring the offline volumes to online state but i am seeing an error. Any help is much appriciated.
#Verify the volume state
$onlinevolumes = Get-NcVol
$onlinevolumes
if ($offlinevolumes = Get-NcVol |where {$_.State -ne "online"}) {
Write-Host "Volumes found which is/are not in online state, non online volumes are:$offlinevolumes"
$userresponse=Read-Host -Prompt "Press any to bring the volumes online"
Set-NcVol ($offlinevolumes |select Name) -Online }
Else {Read-Host -Prompt "No non online volumes found,press any key yo continue"}
-------------------------------------------------------------------------------------------------------------------
Here is the error:
Set-NcVol : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter
'Name'. Specified method is not supported.
At line:13 char:11
+ Set-NcVol ($offlinevolumes |select Name) -Online }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-NcVol], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,DataONTAP.C.PowerShell.SDK.Cmdlets.Volume.Set
NcVol