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
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingCmdletAliases', '')] | |
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] | |
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '')] |
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
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Creates a Systems Manager Association with inline PowerShell. | |
Resources: | |
Association: | |
Type: AWS::SSM::Association | |
Properties: | |
AssociationName: AssociationName | |
Name: AWS-RunPowerShellScript | |
Parameters: |
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
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: SQS Queue with Lambda Trigger | |
Parameters: | |
LambdaS3BucketName: | |
Type: String | |
Description: S3 Bucket Name holding the Lambda Function Package |
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
(Get-Item -Path 'HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters').GetValue('HostName') |
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
brew cask install quicklook-json |
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
$managedInstanceId = (Get-Content -Path 'C:\ProgramData\Amazon\SSM\InstanceData\Vault\Store\RegistrationKey' -Raw | ConvertFrom-Json).instanceID | |
$moduleNames = @( | |
'AWSPowerShell', | |
'ClipboardText', | |
'Convert', | |
'PSWindowsUpdate' | |
) | |
$complianceItems = [System.Collections.Generic.List[Amazon.SimpleSystemsManagement.Model.ComplianceItemEntry]]::new() | |
foreach ($moduleName in $moduleNames) |
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
$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() |
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
aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux-2/arm64/recommended |
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
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)) |
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
function Get-EpochTimeFrom { | |
param ( | |
[int]$Seconds | |
) | |
(Get-Date -Date '01-01-1970') + ([System.TimeSpan]::FromSeconds($Seconds)) | |
} |
OlderNewer