Skip to content

Instantly share code, notes, and snippets.

@Fazzani
Last active July 13, 2018 09:00
Show Gist options
  • Save Fazzani/ce86f0c8ec49b2aa43b8b9ac2188b78d to your computer and use it in GitHub Desktop.
Save Fazzani/ce86f0c8ec49b2aa43b8b9ac2188b78d to your computer and use it in GitHub Desktop.
SeLoger bash docker aws cli and eks cli
if ( -not (test-path $PROFILE) ) {
new-item -path $PROFILE -itemtype file -force
}
Else {
$A = Get-Content $PROFILE
}
# Install notification module
if (-not (Get-Module -ListAvailable -Name BurntToast)) {
Install-Module BurntToast -Force -Confirm:$False
}
If (!( $A -Like "*Docker-Seloger*" )) {
$Content = @(
'$mydoc=$ENV:UserProfile
function Docker-Eks-Seloger {
docker run -it --rm -v "$mydoc\.aws\config:/root/.aws/config" -v "$mydoc\.aws\credentials:/root/.aws/credentials" -v "$mydoc/.kube/config:/root/.kube/config" --name eks-cli synker/seloger_eks:1.0.0 /bin/bash -c "aws eks $args"
}
function Docker-Kubectl-Seloger {
docker run -it --rm -v "$mydoc\.aws\config:/root/.aws/config" -v "$mydoc\.aws\credentials:/root/.aws/credentials" -v "$mydoc/.kube/config:/root/.kube/config" --name eks-cli synker/seloger_eks:1.0.0 /bin/bash -c "kubectl $args"
}
function Docker-Awscli-Seloger {
docker run -it --rm -v "$mydoc\.aws\config:/root/.aws/config" -v "$mydoc\.aws\credentials:/root/.aws/credentials" -v "$mydoc/.kube/config:/root/.kube/config" --name eks-cli synker/seloger_eks:1.0.0 /bin/bash -c "aws $args"
}
function Docker-Seloger {
docker run -it --rm -v "$mydoc\.aws\config:/root/.aws/config" -v "$mydoc\.aws\credentials:/root/.aws/credentials" -v "$mydoc/.kube/config:/root/.kube/config" --name eks-cli synker/seloger_eks:1.0.0 /bin/bash -c "$args"
}
New-Alias sle Docker-Eks-Seloger
New-Alias sla Docker-Awscli-Seloger
New-Alias slk Docker-Kubectl-Seloger
New-Alias slbash Docker-Seloger
')
$Content | Add-Content $PROFILE -Encoding UTF8
Write-Output "Seloger eks cli alias was successfully installed..."
Write-Output "Reloading the current Powershell user profile => $PROFILE"
New-BurntToastNotification -AppLogo "https://pbs.twimg.com/profile_images/822375440790777856/kakbzmX-_400x400.jpg" -Text "SeLoger EKS CLI" , "Seloger eks cli alias was successfully installed...)"
& $profile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment