Would appreciate some help on this… I’m not able to run this function when passing variables to it from earlier in the same script where I am calling the function. It’s basically giving the error “Update-SharePoint : A positional parameter cannot be found that accepts argument ‘-aqualnkMember’.” I have even tried adding “[CmdletBinding(PositionalBinding=$false)]” to the top of the function, but that didn’t help. I think it has something to do with using variables for the parameters of the function I’m calling.
Here is what I’m running that is working successfully:
Update-SharePoint -Computer xts028 -include_debug -aqualnkMember -MigrationDate '2019-09-09T12:00:00Z' -IPAddress '10.50.5.235' -OSVersion 'Windows 7 Professional Service Pack 1'
Here is what I’m running that is failing:
Update-SharePoint -Computer $Computer -include_debug $aqualnkMember $MigrationDate $IPAddress $OSVersion"
When I run “Write-Host” with the above code, it comes out exactly the same output as the code that works:
###INPUT: Write-Host "Update-SharePoint -Computer $Computer -include_debug $aqualnkMember $MigrationDate $IPAddress $OSVersion" ###OUTPUT: Update-SharePoint -Computer xts086 -include_debug -aqualnkMember -MigrationDate '08-22-2019T12:00:00Z' -IPAddress '10.50.5.235' -OSVersion 'Windows 10 Pro'
Why is it not working when I use variables when the output appears to look the same as the version that works when typing everything out?