@Shane Walford
According to the example supplied here, you are missing closing and opening single quotes. Please give this a try and see if it resolves your issue.
az vm run-command invoke --command-id RunPowerShellScript --resource-group MyRG --name Myserver --scripts 'param([string]$Credentials)' 'Remove-Computer -UnjoinDomaincredential $Credentials --PassThru -Verbose -Restart -Force' --parameters "Credentials=$Credential"
Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.