I'm using Pageant 0.70 to load keys on Windows 10 via a PowerShell script:
profile-file.ps1
$pageant-path = "c:\full-path-to-pageant.exe"
$keypath1 = c:\full-path-to-key1
$keypath2 = c:\full-path-to-key2
$keypath3 = c:\full-path-to-key3
init.ps1
# sourcing from profile
. profile-file.ps1
# load keys - doing this because keys are in different locations and paths are too long to have in one spot
& $pageantpath -a "$keypath1"
& $pageantpath -a "$keypath2"
& $pageantpath -a "$keypath3"
When the Pageant commands in init.ps1 run, for each one I get the error popup
couldn't open this key (unable to open file")
But when I check Pageant after clearing the popups, the keys are all successfully loaded in Pageant and I can use them.
I've tried
- Wrapping key in quotes
- Using the
-cflag on Pageant to run a command - Running from command line
- Using/not using
-aPageant command line switch
So far, all of these are having the same result - I get error popups but the keys load. Any other approaches I can use to prevent these error popups?