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
# Save this file and import it using the command `Imort-Module '<path to file'` | |
$Script:Demo = @( | |
@' | |
$PSVersionTable | |
'@ | |
@' | |
Get-Command *AzAccount* |
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
#region BootstrapProfile | |
try { | |
Import-Module 'posh-git' -ErrorAction 'stop' | |
} | |
catch {} | |
if ( | |
$host.Name -eq 'Visual Studio Code Host' -or | |
(Get-Process -Id $PID).Parent.ProcessName -like 'Code*' | |
) { |
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
# Script originally from: https://jdhitsolutions.com/blog/powershell/4445/simulating-a-powershell-demo/ | |
# Slightly modified by @SimonWahlin | |
Function Start-TypedDemo { | |
<# | |
.SYNOPSIS | |
Simulate a PowerShell session | |
.DESCRIPTION | |
This command simulates an interactive PowerShell session. It will process a text file of PowerShell commands. The function will insert your prompt and "type" out each command when you press any key. At the end of the typed command or whenever a pipe character is inserted, the script will pause. Press Enter or any key to continue. | |
If it is the end of the command pressing Enter will execute the command. Use the -NoExecute parameter to run through the demo without executing any commands. Commented lines will be skipped. Press 'q' or ESC at any pause to quit the demo. |
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
#requires -Version 4.0 | |
<# | |
Author: Luke Murray (Luke.Geek.NZ) | |
Version: 0.1 | |
Purpose: Windows 10 Baseline Hardening using DSC per DoD DISA STIG recommendations 22/06/18. | |
Modified to include comments explaining config by Frankie McDonough 01/23/19. | |
#> | |
Configuration 'Win10' | |
{ |
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 Send-PSNotification { | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory,ValueFromPipeline,Position=0)] | |
[object] | |
$Body, | |
[String] | |
$Summary = 'PowerShell Notification', |
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 Send-PSNotification { | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory,ValueFromPipeline,Position=0)] | |
[object] | |
$Body, | |
[String] | |
$Summary = 'PowerShell Notification', |
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
<# | |
.SYNOPSIS | |
Change language settings for a PowerPoint presentation | |
.EXAMPLE | |
PS> Set-PowerPointLanguage -Path MyPres.pptx | |
Writes a copy of MyPres.pptx to MyPres.en-us.pptx with the language set to 'en-US' - English (the default) | |
.EXAMPLE | |
PS> Set-PowerPointLanguage -Path MyPres.pptx -Language de-DE |
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
#!C:\Program\ Files\PowerShell\6.0.0\pwsh.exe -File | |
$Pattern = '^origin\s+https://(\S+)\s\(push\)' | |
$Origin = (& 'git' 'remote' '-v') -match $Pattern | Where-Object -FilterScript {$_ -is [string]} | |
$RemoteDomain = if($Origin -match $Pattern) {$Matches[1]} | |
$Email = & 'git' 'config' '--get' 'user.email' | Where-Object -FilterScript {$_ -is [string]} | |
$DesiredEmail = switch -Wildcard ($RemoteDomain) { | |
'simonwahlin.visualstudio.com*' { | |
'[email protected]' | |
break |
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 Test { | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory=$true,Position=1)] | |
[string]$smtpServer, | |
[Parameter(Position=2)] | |
[switch]$logging, | |
[Parameter(Position=4)] |
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
Verifying that +simonwahlin is my blockchain ID. https://onename.com/simonwahlin |
NewerOlder