- don't use cmd prompt for anything, use PowerShell
- install latest windows terminal from store, don't use default terminals, they are terrible and less featured.
- Suggest installing PowerShell 7 as your normal windows base terminal to use.
- Install Scoop to make this super easy to install.
scoop install pwsh
- Open
pwsh
(PowerShell 7) as your default in Terminal
Originally From colinsalmcorner
To create a YML pipeline, you'll need a name as well as the repository, branch and path to the YML file within the repo (the path relative to the root path of the repo):
az pipelines create -p $ProjectName --org $orgUrl --name $PipelineName --description $PipelineDescription --repository $RepoName --repository-type tfsgit --branch master --skip-first-run --yml-path $YmlPath
This file contains hidden or 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
import argparse, sys, os | |
from diagrams import Cluster, Diagram, Edge | |
from diagrams.aws.compute import ECS, Fargate,EC2 | |
from diagrams.aws.network import ( | |
VPC, | |
PrivateSubnet, | |
PublicSubnet, | |
InternetGateway, | |
) | |
from diagrams.aws.security import WAF |
This file contains hidden or 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
package main | |
import ( | |
"errors" | |
"flag" | |
"fmt" | |
"io" | |
"os" | |
"strings" | |
"time" |
This file contains hidden or 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
#requires -Version 7 -Modules PSFramework, AWS.Tools.Common, AWS.Tools.EC2, ImportExcel | |
$ec2 = (Get-EC2Instance -InstanceId $InstanceIds).Instances | |
$Images = Get-EC2Image -ImageId $ec2.ImageId | |
$report = $ec2 | Select-PSFObject * -ScriptProperty @{ | |
Name = @{ | |
get = { $this.Tags.GetEnumerator().Where{ $_.Key -eq 'Name' }.Value } | |
} | |
ImageCreationDate = @{ | |
get = { |
This file contains hidden or 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
|
This file contains hidden or 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
#Requires -Modules PowerShellHumanizer, AWS.Tools.Common, AWS.Tools.SimpleSystemsManagement, InvokeBuild | |
# Example of using InvokeBuild with Invoking an SSM Automation Document and waiting for a response | |
# Ideally this would be good to have in seperate functions, but for quick adhoc work this works well. | |
task ssm-test-aws-ssm-automation { | |
@( | |
'Aws.Tools.Common' | |
'AWS.Tools.SimpleSystemsManagement' |
This file contains hidden or 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
# https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-win.html | |
$ProgressPreference = 'SilentlyContinue' | |
Write-Host 'Downloading installer' | |
$InstallerFile = Join-Path $env:USERPROFILE 'Downloads\SSMAgent_latest.exe' | |
$invokeWebRequestSplat = @{ | |
Uri = 'https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe' | |
OutFile = $InstallerFile | |
} | |
Invoke-WebRequest @invokeWebRequestSplat |
This file contains hidden or 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
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.141.0/containers/python-3/.devcontainer/base.Dockerfile | |
# [Choice] Python version: 3, 3.8, 3.7, 3.6 | |
ARG VARIANT="3.8" | |
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} | |
# [Option] Install Node.js | |
ARG INSTALL_NODE="true" | |
ARG NODE_VERSION="lts/*" | |
RUN if [ "${INSTALL_NODE}" = 'true' ]; Then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi |