View 04-05-lambda-container.sh
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
# Source: https://gist.github.com/7e0ada996b5d09486f2df0d7e1cbbea2 | |
############################################### | |
# Amazon Lambda Containers # | |
# Packaging AWS Functions as Container Images # | |
# https://youtu.be/DsQbBVr-GwU # | |
############################################### | |
# Requirements: | |
# - AWS account (https://aws.amazon.com/) |
View Wireless_profiles.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
netsh wlan show profiles | | |
Select-String ': *(.+)$' | ForEach-Object { | |
$_.Matches.Groups[1].Value | |
} |
View Get-EC2Ami.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-EC2Ami { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory, Position = 0, ValueFromPipeline)] | |
[SupportsWildcards()] | |
[String] $ImageType, | |
[Parameter(Mandatory, Position = 1)] | |
[ArgumentCompleter( { (Get-AWSRegion).Region })] | |
[String] $Region, |
View AWS_Lambda_PowerOff.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
# PowerShell script file to be executed as an AWS Lambda function. | |
# | |
# When executing in Lambda the following variables will be predefined. | |
# $LambdaInput - A PSObject that contains the Lambda function input data. | |
# $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment. | |
# | |
# The last item in the PowerShell pipeline will be returned as the result of the Lambda function. | |
# | |
# To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement | |
# indicating the module and version. |
View Invoke-FileArchive.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 Invoke-FileArchive { | |
param ( | |
[Parameter( | |
Mandatory, | |
Position = 0, | |
ValueFromPipeline, | |
ValueFromPipelineByPropertyName | |
)] | |
[Alias('FullName')] | |
[System.IO.FileSystemInfo[]] $Path, |
View Invoke-BalloonMessage.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 Invoke-BalloonMessage { | |
Param ( | |
[Parameter(Mandatory)] | |
[string] $Message, | |
[Parameter()] | |
[string] $Title = "Attention $env:username", | |
[Parameter()] | |
[ValidateSet('none', 'Info', 'Warning', 'Error')] |
View Get-BitLockerStatus.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-BitLockerStatus { | |
[CmdletBinding()] | |
param ( | |
[Parameter(ValueFromPipeline)] | |
[Microsoft.ActiveDirectory.Management.ADComputer] $Computers, | |
[parameter(Mandatory)] | |
[pscredential] $Credential | |
) | |
process { |
View Get-BinaryToText.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-BinaryToText { | |
param ( | |
[Parameter(ValueFromPipeline)] | |
[String] $string | |
) | |
process { | |
($string -split ' ' | | |
ForEach-Object { | |
[char]( | |
[convert]::ToInt32($_, 2) |
View aes-encryption.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
## A PowerShell conversion of the C# code in the article, https://www.c-sharpcorner.com/article/aes-encryption-in-c-sharp/ ## | |
using namespace System.IO | |
using namespace System.Security.Cryptography | |
class ManageAes { | |
static [void] Main() { | |
[string] $data = Read-Host -Prompt "Enter text that needs to be encrypted" | |
[ManageAes]::EncryptAesManaged($data) | |
} |
View Format-Member.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 Format-Member { | |
[CmdletBinding()] | |
[alias("fm")] | |
param ( | |
[parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] | |
[System.Management.Automation.PSObject] | |
$InputObject | |
) |
NewerOlder