powershell - A positional parameter cannot be found that accepts argument 'System.Management.Automation.PSCredential' -
i'm try running dsc configuration in azure automations, get's suspended following exception:
"the running command stopped because preference variable "erroractionpreference" or common parameter set stop: positional parameter cannot found accepts argument 'system.management.automation.pscredential'.
the code i'm running :
configuration domainjoin{ $cred = get-automationpscredential -name "azurelogin" login-azurermaccount $cred import-dscresource -modulename 'psdesiredstateconfiguration' import-dscresource -modulename 'xdscdomainjoin' $dscdomainadmin = get-azurermautomationcredential -name "gsy admin" -resourcegroupname "rg-dc-rocs" -automationaccountname "rocsautomation" $dscdomainname = get-azurermautomationvariable -name "dscdomainname" -resourcegroupname "rg-dc-rocs" -automationaccountname "rocsautomation" #psdscallowdomainuser = $true node localhost { xdscdomainjoin joindomain { domain = $dscdomainname credential = $dscdomainadmin } } }
any idea how can solve exception?
i think might need change:
login-azurermaccount $cred
to:
login-azurermaccount -credential $cred
it seems -credential
has named used.
Comments
Post a Comment