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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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/) |
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 | |
} |
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, |
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. |
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, |
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')] |
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 { |
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) |
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) | |
} |
NewerOlder