Skip to content

Instantly share code, notes, and snippets.

View dustindortch's full-sized avatar

Dustin Dortch dustindortch

View GitHub Profile
@dustindortch
dustindortch / TeslaCam.ps1
Created November 28, 2019 21:22
Creating a Sentry Mode disk for a Tesla with PowerShell (Assuming the G drive is the desired volume)
Format-Volume -DriveLetter G -FileSystem FAT32 -Full -Force
New-Item -Path G:\ -Name 'TeslaCam' -Type Directory
@dustindortch
dustindortch / prompt.ps1
Created May 16, 2019 01:24 — forked from corbob/prompt.ps1
prompt...
$forePromptColor = 0
[System.Collections.Generic.List[ScriptBlock]]$global:PromptRight = @(
# right aligned
{ "$FG;${er}m{0}" -f $LeftArrow }
{ "$FG;${forePromptColor}m$BG;${er}m{0}" -f $(if (@(get-history).Count -gt 0) {(get-history)[-1] | % { "{0:c}" -f (new-timespan $_.StartExecutionTime $_.EndExecutionTime)}}else {'00:00:00.0000000'}) }
{ "$FG;7m$BG;${er}m{0}" -f $LeftArrow }
{ "$FG;0m$BG;7m{0}" -f $(get-date -format "hh:mm:ss tt") }
)
# Pester testing
## Prep work
## Depends - Pester, AzureADPreview, and xAzureAD.DirectorySettings modules
## Get original values - Get-AzureADDirectorySetting -Name Group.Unified | Export-Csv <Path> -NoTypeInformation
$ExpectedSettings = Import-Csv <Path>
Describe 'Azure AD Group Creation Settings' {
$ActualSettings = Get-AzureADDirectorySetting -Name Group.Unified
While ($True) {
Write-Output "This is my output"
Get-Date
Start-Sleep -s 300 # Sleep for 5 minutes
}
Function Get-Food {
Param(
[Parameter(ValueFromPipeline)]
[String[]]$Types
)
$Seed = Get-Random -Minimum 0 -Maximum $($Types.Count - 1)
Write-Output $Types[$Seed]
}
Function Get-TacosOrGyros {
$Seed = Get-Random -Minimum 0 -Maximum 100
If(($Seed % 2) -eq 0) {
Write-Output "Tacos"
} Else {
Write-Output "Gyros"
}
}
Function Get-CmdletbindingExample {
[CmdletBinding()]
Param (
[String[]]$Name
)
Begin {# Runs once}
Process {
# Runs for each instance of $Name
Function Get-CmdletbindingExample {
[CmdletBinding()]
Param (
[String[]]$Name
)
Begin {# Runs once}
Process {# Runs for each instance of $Name}
@dustindortch
dustindortch / Connect-MicrosoftTeams
Created January 4, 2018 13:12
Connect-MicrosoftTeams
Connect-MicrosoftTeams
@dustindortch
dustindortch / JoinedTeams
Created January 4, 2018 13:10
JoinedTeams
/beta/me/joinedTeams