Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stknohg/27ea862b5a3e94b4af4919eeed5329be to your computer and use it in GitHub Desktop.
Save stknohg/27ea862b5a3e94b4af4919eeed5329be to your computer and use it in GitHub Desktop.
AWS CloudShellのPowerShellにデフォルトでインストールされる AWSPowerShell.NetCore モジュールを削除するコマンド
# CloudShell の $Profile に仕込む想定
if ($env:AWS_EXECUTION_ENV -eq 'CloudShell') {
$moduleBase = (Get-Module AWSPowerShell.NetCore -ListAvailable).ModuleBase
if ($null -ne $moduleBase) {
$modulePath = Split-Path -Parent $moduleBase
if (Test-Path $modulePath) { sudo rm -rf $modulePath }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment