Get-Credential call fails if using Execute as Script

Issue #231 new
Dmitry Mashkov created an issue

A simple demo: $cred = Get-Credential

Works fine in ISE/PowerShell, fails in POSH Tools 5.1.4 project if script is started with “Execute as script”. Following error is reported:

PS C:\…> C:\…\BuildDSC.ps1
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential: [ERROR] Status(StatusCode=Unknown, Detail="Exception was thrown by handler.")
[ERROR] At C:\…\BuildDSC.ps1:4 char
[ERROR] :1
[ERROR] + $cred = Get-Credential
[ERROR] + ~~~~~~
[ERROR] + CategoryInfo : OperationStopped: (:) [], RpcException
[ERROR] + FullyQualifiedErrorId : Grpc.Core.RpcException
[ERROR]

Comments (0)

  1. Log in to comment