$ git log origin/master..HEAD
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
# Define an array of services | |
$services = 'service1','service2','service3','service4' | |
# Iterate through each item in the array | |
foreach ($service in $services) { | |
# Get the service and save it to the variable | |
$serviceObj = Get-Service -Name $service | |
# if the variable is present - An If statement returns a bool value | |
if ($serviceObj) { |
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 Enter-PSCmdletContext { [CmdletBinding()]param() $Host.EnterNestedPrompt() }, | |
Enter-PSCmdletContext | |
$PSCmdlet | |
$TAType = [psobject].Assembly.GetType("System.Management.Automation.TypeAccelerators") | |
$TAType::Add('accelerators',$TAType) | |
# this now works | |
[accelerators]::Add() |
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-ShadowStorageSpace { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory, | |
Position = 0, | |
ValueFromPipeline=$true, | |
ValueFromPipelineByPropertyName=$true)] | |
[string[]] | |
$ComputerName | |
) |
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's all enabled users from the all users group which is populated nightly. | |
$usersall = Get-ADUser -Filter * | |
#Declare pattern match to remove non integer characters. | |
$numpattern = '[^0-9]' | |
#Iterate through users applying replaced value | |
$users | ForEach-Object { | |
$regexedmobile = $_.mobile -replace $numpattern,'' | |
$userobj = [pscustomobject]@{ |
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 New-MsTeamsChannel { | |
[cmdletbinding(DefaultParameterSetName = 'Input')] | |
param ( | |
[Parameter(Mandatory, | |
Position = 0, | |
ValueFromPipeline, | |
ValueFromPipelineByPropertyName, | |
ParameterSetName = 'Input')] | |
[string[]] | |
$DisplayName, |
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
2018/12/10 14:44:27 [INFO] Terraform version: 0.11.10 17850e9a55d33c43d7c31fd6ac122ba97a51d899 | |
2018/12/10 14:44:27 [INFO] Go runtime version: go1.11.1 | |
2018/12/10 14:44:27 [INFO] CLI args: []string{"C:\\Program Files\\terraform\\terraform.exe", "plan"} | |
2018/12/10 14:44:27 [DEBUG] Attempting to open CLI config file: C:\Users\brett.miller\AppData\Roaming\terraform.rc | |
2018/12/10 14:44:27 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2018/12/10 14:44:27 [INFO] CLI command args: []string{"plan"} | |
2018/12/10 14:44:27 [INFO] command: empty terraform config, returning nil | |
2018/12/10 14:44:27 [DEBUG] command: no data state file found for backend config | |
2018/12/10 14:44:27 [DEBUG] New state was assigned lineage "b9a87e1d-da03-8cf9-fae1-6834b2e6e4ad" | |
2018/12/10 14:44:27 [INFO] command: backend initialized: <nil> |
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
# Stolen from here: https://github.com/petere/git-whoami/blob/master/git-whoami | |
function Git-Whoami { | |
$author = git config user.name | |
$email = git config user.email | |
[pscustomobject]@{ | |
Author = $author | |
Email = $email | |
} | |
} |
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
{ | |
"files.defaultLanguage": "powershell", | |
"window.zoomLevel": -1, | |
"editor.renderWhitespace": "all", | |
"powershell.integratedConsole.focusConsoleOnExecute": false, |
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-MsTeamsGroupId { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true, | |
Position=0, | |
ValueFromPipeline=$true, | |
ValueFromPipelineByPropertyName=$true)] | |
[ValidateNotNullOrEmpty()] | |
[string] | |
$TeamName |