So my goal is to only change one variable in one location in the script, as a result I have nested variables. Here's a more complete view into what I'm trying to accomplish:
# this is the only variable to change
$subnet = "xx"
$TimeServers = "xxx.xx.$subnet.50,xxx.xx.$subnet.51,xxx.xx.$subnet.2"
Set-NaOption -OptionName timed.servers -OptionValue $TimeServers
The output of Write-Host $TimeServers looks good, 3 comma seperated ip addresses with
Here's the error message when the script runs:
Set-NaOption : Unable to set option: timed.servers
At P:\My Documents\WindowsPowerShell\timed_servers.ps1:57 char:1
+ Set-NaOption -OptionName timed.servers -OptionValue $TimeServers
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (xxx.xx.xx.xx:NaController) [Set-NaOption], EAPIERROR
+ FullyQualifiedErrorId : ApiException,DataONTAP.PowerShell.SDK.Cmdlets.Options.SetNaOption