$application = "C:\Program Files (x86)\TeamViewer\TeamViewer.exe" $command_string = " assign --api-token XXXXX-XXXXXXXXXXX --alias %Computername%-%username% --group $SiteInitials --reassign" & $application $command_string$application = "C:\Program Files (x86)\TeamViewer\TeamViewer.exe" $command_string = " assign --api-token XXXXX-XXXXXXXXXXX --alias %Computername%-%username% --group $SiteInitials --reassign" & $application $command_stringCheck below documentation
Thank you - based on the following from that article, I see:
Start-Process -FilePath “$env:comspec” -ArgumentList “/c dir `”%systemdrive%\program files`""
Would this be the solution?
$application = “C:\Program Files (x86)\TeamViewer\TeamViewer.exe”
$command_string = " assign --api-token XXXXX-XXXXXXXXXXX --alias %Computername%-%username% --group $SiteInitials --reassign"
Start-Process -FilePath $application -ArgumentList $command_string
I ask only because it does not appear to work when I run it here.
Arguments are an string array, so it can be formatted like this:
$command_string = "assign",
"--api-token XXXXX-XXXXXXXXXXX",
"--alias %Computername%-%username%",
"--group $SiteInitials",
"--reassign"
Oops - I found it - I needed to run this as Administrator. Once I did that it all works as expected.
Thank you guys for your help. You guys rock! Especially as a sanity check!
Thanks,
Paul