View Get-AWSCommandsFromFile.ps1
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
function Get-AWSCommandsFromFile { | |
[CmdletBinding()] | |
param ( | |
[ValidateScript({Test-Path -Path $_ -PathType Leaf})] | |
$FilePath | |
) | |
$awsCommands = @{} | |
$tokens = [System.Management.Automation.PSParser]::Tokenize((Get-Content -Path $FilePath -Raw), [ref]$null) |
View Windows10-1809-RAST
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
# Get a list of RSAT Capabilities | |
Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property DisplayName, State | |
# Install RSAT | |
Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online |
View Invoke-FastPing
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
# This has been replaced by the FastPing PowerShell Module. | |
## Source | |
[GitHub](]https://github.com/austoonz/FastPing) | |
## Installation | |
```powershell | |
Install-Module -Name FastPing -Scope CurrentUser |
View AWS-ApplyDSCMofs
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
# Overview | |
This Gist provides samples to simplify the usage of the AWS Systems Manager Document, "AWS-ApplyDSCMofs". |
View SSMAssociation
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
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: "Systems Manager Association" | |
Resources: | |
Association: | |
Type: AWS::SSM::Association | |
Properties: |
View Create-SSMAssociation
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
$ProfileName = '' | |
$AWSRegion = 'us-west-2' | |
$AssociationName = 'MyAssociationName' | |
$ComplianceSeverity = [Amazon.SimpleSystemsManagement.AssociationComplianceSeverity]::MEDIUM | |
$MaxConcurrency = '10%' | |
$MaxError = '5%' | |
$ExecutionTimeoutInSeconds = '300' | |
$ScheduleExpression = 'rate(1 hour)' |
View Get-EpochTimeFrom.ps1
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
function Get-EpochTimeFrom { | |
param ( | |
[int]$Seconds | |
) | |
(Get-Date -Date '01-01-1970') + ([System.TimeSpan]::FromSeconds($Seconds)) | |
} |
View Get-AWSRegionLatency
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
function Get-AWSRegionLatency { | |
param ( | |
[ValidateSet('dynamodb')] | |
[String] $ServiceForMeasurement = 'dynamodb' | |
) | |
$endpoints = [System.Collections.ArrayList]::new() | |
$regions = (Get-AWSRegion | Where-Object {$_.Region -notlike 'us-iso*'}).Region | |
foreach ($region in $regions) { | |
$null = $endpoints.Add(('{0}.{1}.amazonaws.com' -f $ServiceForMeasurement, $region)) |
View get-arm64-ami-ids
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
aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux-2/arm64/recommended |
View Write-SSMInventoryExample
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
$powerShellModules = Get-Module -ListAvailable | |
$date = Get-Date -UFormat '+%Y-%m-%dT%H:%M:%SZ' | |
$inventoryItems = [System.Collections.Generic.List[Amazon.SimpleSystemsManagement.Model.InventoryItem]]::new() | |
$contentList = [System.Collections.Generic.List[System.Collections.Generic.Dictionary[System.String,System.String]]]::new() | |
foreach ($moduleName in ($powerShellModules | Select-Object -Property Name -Unique).Name) | |
{ | |
$module = $powerShellModules.Where({$_.Name -eq $moduleName}) | Sort-Object -Property Version -Descending | Select-Object -First 1 | |
$contentDictionary = [System.Collections.Generic.Dictionary[System.String,System.String]]::new() |
NewerOlder