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 Remove-FileSystemItem { | |
<# | |
.SYNOPSIS | |
Removes files or directories reliably and synchronously. | |
.DESCRIPTION | |
Removes files and directories, ensuring reliable and synchronous | |
behavior across all supported platforms. | |
The syntax is a subset of what Remove-Item supports; notably, |
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 7 | |
#You can load this script with $(iwr https://tinyurl.com/TraceAICommand | iex) | |
using namespace Microsoft.ApplicationInsights | |
using namespace Microsoft.ApplicationInsights.Extensibility | |
using namespace Microsoft.ApplicationInsights.DataContracts | |
using namespace System.Management.Automation | |
using namespace System.Collections.Generic | |
using namespace System.Net | |
#Reference: https://docs.microsoft.com/en-us/azure/azure-monitor/app/console |
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
1..100 | ForEach-Object { | |
$number = $Psitem | |
switch (($number % 5) -eq 0 -and ($number % 3 -eq 0)) { | |
$true { 'FizzBuzz' } | |
Default { | |
switch ($number % 3) { | |
0 { 'Fizz' } | |
Default { | |
switch ($number % 5) { | |
0 { 'Buzz' } |
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
######## POSH-GIT | |
# with props to https://bradwilson.io/blog/prompt/powershell | |
# | |
# | |
# Now for this to work most beautifully - you will need to have the latest posh-git module | |
# | |
# You will also need the MesloLGM Nerd Font Mono font | |
# from here https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Meslo/M/Regular/complete/Meslo%20LG%20M%20Regular%20Nerd%20Font%20Complete.ttf | |
# if you are super nerdy | |
# or |
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
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco install chocolatey -y | |
choco install 1password -y | |
choco install azure-data-studio -y | |
choco install azure-functions-core-tools-3 -y | |
choco install azure-cli -y | |
choco install bicep -y | |
choco install chocolatey-core.extension -y |
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
([adsi]'WinNT://domain/username,user').ChangePassword('oldpassword','newpassword') |