Based off of several blog posts I attempted the code below:
$n1 = New-Object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList "People", "http://myURL", $true
$n1.properties["Target"] = "_blank"
$n1.Update()
This results in the error below with line 24 referencing the 2nd line of the code above.
Cannot index into a null array. At
Z:\myscripts\SearchDropdownMenuSetup.ps1:24 char:5
+ $n1.properties["Target"] = "_blank"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Is there any reason why I couldn't do this logic in PowerShell?