When powershell is unable to identify type of a variable used, it uses PSObject / PSMethod which causes the issue. Try using explicit type casting to see if that solves the issue.
Invoke-SwisVerb $swis -EntityName "Orion.Nodes" -Verb "Unmanage" -Arguments @([String]"N:2", [Datetime]$unmanagefrom, [Datetime]$unmanageto, $false)
1 of 1 people found this helpful
The problem is this line:
$unmanagefrom = [Datetime]::UtcNow.Add
What you meant to say was this:
$unmanagefrom = [Datetime]::UtcNow
"Add" is a method. Probably just a copy/paste mistake. I don't think you need the "[string]" or "[Datetime]" markers in the verb arguments.
Couldn't see it for looking at it.