PS Studio 2022 and ssh behavior not ideal

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 1 year and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
mar10c--
Posts: 59
Last visit: Mon May 22, 2023 6:53 am

PS Studio 2022 and ssh behavior not ideal

Post by mar10c-- »

Product, version and build: PS Studio 2022 Trial Version
Operating system: Win 11
PowerShell version(s): 7
32-bit version of software? 64

In PS Studio 2022, the ssh cmd prompt appears whenever a remote ps script using ssh is executed, how can that be suppressed? This is not a good behavior because the cmd prompt gets in the way of the messagebox or inputbox. In PS Studio 2019 i was not seeing this behavior which was ideal.
sshprompt 2022-12-10 065430.png
sshprompt 2022-12-10 065430.png (64.67 KiB) Viewed 4189 times
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: PS Studio 2022 and ssh behavior not ideal

Post by brittneyr »

Does this also happen when you run your script with Windows PowerShell (v5) instead of PowerShell 7?
Brittney
SAPIEN Technologies, Inc.
User avatar
mar10c--
Posts: 59
Last visit: Mon May 22, 2023 6:53 am

Re: PS Studio 2022 and ssh behavior not ideal

Post by mar10c-- »

I have to use PS7 for advanced ssh support since V5 doesn't do it.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: PS Studio 2022 and ssh behavior not ideal

Post by brittneyr »

We are looking into this and will get back to you soon.
Brittney
SAPIEN Technologies, Inc.
User avatar
mar10c--
Posts: 59
Last visit: Mon May 22, 2023 6:53 am

Re: PS Studio 2022 and ssh behavior not ideal

Post by mar10c-- »

Thank you for looking into this.

This works well in PS Studio 2019. the ssh window won't appear. Example code.
$session = New-PSSession -HostName $remotecomputer
$output = Invoke-Command -Session $session -ScriptBlock { Get-Hotfix }
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: PS Studio 2022 and ssh behavior not ideal

Post by brittneyr »

Are your scripts connecting to your remote machine when it opens a cmd prompt?

Are you also prompted when you run from the console (Ctrl + F8)?
Brittney
SAPIEN Technologies, Inc.
User avatar
mar10c--
Posts: 59
Last visit: Mon May 22, 2023 6:53 am

Re: PS Studio 2022 and ssh behavior not ideal

Post by mar10c-- »

The scripts are connecting to a remote machine with the cmd prompt opens. CTL-F8 simply will not run the script.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: PS Studio 2022 and ssh behavior not ideal

Post by brittneyr »

Does a cmd prompt open when you run outside of PowerShell Studio in a PowerShell Console?
Brittney
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: PS Studio 2022 and ssh behavior not ideal

Post by brittneyr »

When the Credentials parameter was added, I did not get the cmd console prompting:
  1. $session = New-PSSession -ComputerName $remotecomputer -Credential $credentials
Brittney
SAPIEN Technologies, Inc.
User avatar
mar10c--
Posts: 59
Last visit: Mon May 22, 2023 6:53 am

Re: PS Studio 2022 and ssh behavior not ideal

Post by mar10c-- »

$session = New-PSSession -ComputerName $remotecomputer -Credential $credentials would work because it is using WinRM. However, $session = New-PSSession -HostName $remotecomputer is used for SSH. -HostName instead of -ComputerName and -Credential is not required since the Public key is loaded on the remote system.
This topic is 1 year and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.