3 $my_key_id = gpg --list-secret-keys --keyid-format LONG |
4 Select-String -Pattern '\.*sec.*\/' |
7 $_.Line.split('/')[1].split(' ')[0]
12 $my_name = git config --global user.name
13 $my_email = git config --global user.email
17 %echo Generating RSA 3072 key
23 Name-Comment: $my_host
27 " | gpg --batch --generate-key
30 $my_asc_relpath = "Downloads/$my_email.$my_key_id.gpg.asc"
31 & gpg --armor --export $my_key_id > "$Env:USERPROFILE/$my_asc_relpath"
33 # TODO use the comment (if any) for the name of the file
34 $my_email = git config --global user.email
36 echo "GnuPG Public Key ID: $MY_KEY_ID"
38 echo "~/$my_asc_relpath":
40 & type "$Env:USERPROFILE/$my_asc_relpath"