This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://stackoverflow.com/a/43317244 | |
$path = ".\aws-ec2-key.pem" | |
# Reset to remove explict permissions | |
icacls.exe $path /reset | |
# Give current user explicit read-permission | |
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)" | |
# Disable inheritance and remove inherited permissions | |
icacls.exe $path /inheritance:r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[cmdletbinding(SupportsShouldProcess=$True)] | |
param( | |
# What .tar.gz file should be extracted? Must exist. | |
[Parameter(Mandatory=$True)] | |
[string]$FileToExtract, | |
# What folder should the files be extracted into? Does not need to exist | |
[Parameter(Mandatory=$True)] | |
[string]$TargetFolder, |