Skip to content

Instantly share code, notes, and snippets.

@skyhoshi
Created February 10, 2023 19:45
Show Gist options
  • Save skyhoshi/5f165e5fe6993172912786c60ea0d9f0 to your computer and use it in GitHub Desktop.
Save skyhoshi/5f165e5fe6993172912786c60ea0d9f0 to your computer and use it in GitHub Desktop.
Create a new SSH Key
$RootProfileStore = "$($env.USERPROFILE)\.ssh";
$StoreLocation = "\";
$Filename = "NameOfSSHFile"
$PrefixFilename = "$(Filename).ssh"
$PathOnly = "$RootProfileStore$StoreLocation"
if (!(Test-Path -Path $PathOnly)){
New-Item -Path $PathOnly -ItemType Directory;
}
$Extension = "Id_rsa";
$FileName = "$($PrefixFilename).$($Extension)";
$FullPath = "$($PathOnly)$($FileName)"
ssh-keygen -f $FullPath ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment