Skip to content

Instantly share code, notes, and snippets.

@ChrisLynchHPE
Created August 28, 2019 18:59
Show Gist options
  • Save ChrisLynchHPE/b0b617ba3a736d2f5b7c3af7c64ef4a3 to your computer and use it in GitHub Desktop.
Save ChrisLynchHPE/b0b617ba3a736d2f5b7c3af7c64ef4a3 to your computer and use it in GitHub Desktop.
# Ports we want to modify
$Ports = "1:0:0", "1:0:1", "2:0:0", "2:0:1"
# Set the portGroup name
$PortGroupName = "MyPortGroup1"
$StorageSystem = Get-HPOVStorageSystem -Name My3ParSystem
ForEach ($port in $Ports)
{
($StorageSystem.ports | ? name -eq $port).groupName = $PortGroup
}
# Now save the storage system object back to the API
Send-HPOVRequest -Uri $StorageSystem.uri -Method PUT -Body $StorageSystem | Wait-HPOVTaskComplete -OutVariable Results
if ($Results.taskState -ne 'Completed')
{
$Results.taskErrors
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment