Feedback:the new parameter identification solves the SSH keygen problem on win #16605
kasini3000
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
hi fans:
This is my feedback (report) to the PowerShell team
kasini3000 is a PowerShell script batch framework.
[jl建立主控机ssh秘钥1z.ps1] It is used to build SSH keyfile in win and Linux
Script call ssh-keygen.exe by paramter [-N '' ] on win ,But PowerShell is not competent
Problem phenomenon:
PowerShell, or pwsh, can recognize the empty string passed to the PS1 script. However, an empty string passed to an external command is not recognized.
test
trace-command -PSHOST -Name ParameterBinding { ssh-keygen -n '' -t rsa -b 4096 -f 'c:\Users\your_user\Documents\kasini3000\ssh_key_files_old1\id_rsa' }
How to fix:
$PSNativeCommandArgumentPassing = 'Standard'
Default is 'windows',this has problem.
final result:
In order to be compatible with the old version of PowerShell and pwsh, I did not use the new parameter variable, but used --%
But I still want to say good gob!
Beta Was this translation helpful? Give feedback.
All reactions