运行Powershell脚本时出现以下错误消息
The property 'value' cannot be found on this object. Verify that the property exists and can be set.
At C:\Test.ps1:17 char:1
+ $usernamefield.value = $username
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
The property 'value' cannot be found on this object. Verify that the property exists and can be set.
At C:\Test.ps1:20 char:1
+ $passwordfield.value = $password
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
Method invocation failed …
Run Code Online (Sandbox Code Playgroud)