Using Powershell 7 in OO

Hi, 

i am trying to use parameters in powershell, which are released in Version 7. While debugging my flow in OO the Powershell Script doesn't know this parameters. It seems, that it is using Powershell 5. 

I Have installed Powershell 7 and the scrip works fine in Visual Studio Code. 

Do you have any suggestions how to use powershell 7 in OO?

 

Thanks in Advise, 

Fabian

Parents
  • Verified Answer

    Hello Fabian710,

    Have you tried providing a PowerSHell 7 configuration to the "configurationName" input?

    "configurationName - The name of the PSSessionConfiguration to use. This can be used to target specific versions of PowerShell if the PSSessionConfiguration is properly configured on the target. By default, after PSRemoting is enabled on the target, the configuration name for PowerShell v5 or lower is 'microsoft.powershell', for PowerShell v6 is 'PowerShell.6', for PowerShell v7 is 'PowerShell.7'. Additional configurations can be created by the user on the target machines.
    Valid values: any PSConfiguration that exists on the host.
    Examples: 'microsoft.powershell', 'PowerShell.6', 'PowerShell.7'"

  •  this is not working at the moment. I have set the configurationName to 'PowerShell.7' but now i get some errors: 

    {exception=dotNETWebActions_PowerShell.PowerShellExceptions.SessionException: Could not connect to host. ---> System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server localhost failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
    --- End of inner exception stack trace ---
    at PowerShellV2.PSRunspaceV2.NewRemoteSession(String host, PSCredential credential, AuthenticationMechanism authentication)
    at PowerShellV2.PSRunspaceV2.CreateRunspace(String host, PSCredential credential, AuthenticationMechanism authentication)
    at PowerShellV2.PSRunspaceV2.CreateNewRunspace()
    at PowerShellV2.PSRunspaceV2..ctor(PSAuthenticationInfo authInfo)
    at PowerShellV2.PowerShellFactoryV2.CreateRemoteRunspace(PSAuthenticationInfo psAuth, Boolean keepSessionAlive, Boolean enablePiping)
    at PowerShellCommon.PowerShellFactory.CreateRunspace(PSAuthenticationInfo authInfo, Boolean keepSessionAlive, Boolean enablePiping)
    at dotNETWebActions_PowerShell.IActions.PowerShellBaseAction.GetPSRunspace(ActionRequest req)
    at dotNETWebActions_PowerShell.IActions.PowerShellBaseAction.ExecutePowerShell(ActionRequest req, ISession s, IActionRegistry reg);returnCode=1;returnResult=Could not connect to host.;sessionId=new session;isSessionOn=False;Result=1;}

Reply
  •  this is not working at the moment. I have set the configurationName to 'PowerShell.7' but now i get some errors: 

    {exception=dotNETWebActions_PowerShell.PowerShellExceptions.SessionException: Could not connect to host. ---> System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server localhost failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
    --- End of inner exception stack trace ---
    at PowerShellV2.PSRunspaceV2.NewRemoteSession(String host, PSCredential credential, AuthenticationMechanism authentication)
    at PowerShellV2.PSRunspaceV2.CreateRunspace(String host, PSCredential credential, AuthenticationMechanism authentication)
    at PowerShellV2.PSRunspaceV2.CreateNewRunspace()
    at PowerShellV2.PSRunspaceV2..ctor(PSAuthenticationInfo authInfo)
    at PowerShellV2.PowerShellFactoryV2.CreateRemoteRunspace(PSAuthenticationInfo psAuth, Boolean keepSessionAlive, Boolean enablePiping)
    at PowerShellCommon.PowerShellFactory.CreateRunspace(PSAuthenticationInfo authInfo, Boolean keepSessionAlive, Boolean enablePiping)
    at dotNETWebActions_PowerShell.IActions.PowerShellBaseAction.GetPSRunspace(ActionRequest req)
    at dotNETWebActions_PowerShell.IActions.PowerShellBaseAction.ExecutePowerShell(ActionRequest req, ISession s, IActionRegistry reg);returnCode=1;returnResult=Could not connect to host.;sessionId=new session;isSessionOn=False;Result=1;}

Children