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
Format-Volume -DriveLetter G -FileSystem FAT32 -Full -Force | |
New-Item -Path G:\ -Name 'TeslaCam' -Type Directory |
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
$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") } | |
) |
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
# 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 |
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
While ($True) { | |
Write-Output "This is my output" | |
Get-Date | |
Start-Sleep -s 300 # Sleep for 5 minutes | |
} |
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-Food { | |
Param( | |
[Parameter(ValueFromPipeline)] | |
[String[]]$Types | |
) | |
$Seed = Get-Random -Minimum 0 -Maximum $($Types.Count - 1) | |
Write-Output $Types[$Seed] | |
} |
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-TacosOrGyros { | |
$Seed = Get-Random -Minimum 0 -Maximum 100 | |
If(($Seed % 2) -eq 0) { | |
Write-Output "Tacos" | |
} Else { | |
Write-Output "Gyros" | |
} | |
} |
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-CmdletbindingExample { | |
[CmdletBinding()] | |
Param ( | |
[String[]]$Name | |
) | |
Begin {# Runs once} | |
Process { | |
# Runs for each instance of $Name |
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-CmdletbindingExample { | |
[CmdletBinding()] | |
Param ( | |
[String[]]$Name | |
) | |
Begin {# Runs once} | |
Process {# Runs for each instance of $Name} | |
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
Connect-MicrosoftTeams |
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
/beta/me/joinedTeams |
NewerOlder