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
## No | |
Do-Thing | Out-Null | |
## yes | |
$null = Do-Thing | |
[void](Do-Thing) |
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
#How to migrate from AAP to RBAC | |
#region basic connects | |
$connectMgGraphSplat = @{ | |
Scopes = @( | |
'AppRoleAssignment.ReadWrite.All', | |
'Application.ReadWrite.All', | |
'User.Read.All' | |
) | |
NoWelcome = $true |
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
alias: | |
- name: a | |
value: aliae | |
- name: g | |
value: git | |
- name: z | |
value: zoxide | |
- name: ls | |
value: exa -la --icons | |
if: hasCommand "exa" |
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
param ( | |
$Organization, | |
$PrivateToken, | |
$ProjectFullPath | |
) | |
$query = @{ | |
query = '{ |
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
<# | |
Prerequisites | |
An Azure subscription is required. | |
Install the Az PowerShell module from the PowerShell Gallery: | |
Install-Module -Name Az | |
Login to Azure: | |
Connect-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
#Requires -Modules PowerShellAI | |
$str = Get-Clipboard | |
$prompt = " | |
Clean up this copy-paste from YouTube and make it suitable for pasting into Notion as meeting notes. | |
- Remove time stamps | |
- Remove line breaks | |
- Grammar, spell check and proper punctuation | |
$str |
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
# Initialize timer variables | |
$timerStart = $null | |
$elapsedTime = $null | |
# Function to display elapsed time | |
function DisplayElapsedTime { | |
param ( | |
[ref]$startTime, | |
[ref]$elapsedTime | |
) |
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
# Disable the OneDrive "On This Day" photo memories notification in Windows 11. | |
New-ItemProperty -Path 'HKCU:\Software\Microsoft\OneDrive\Accounts\Personal\' -Name OnThisDayPhotoNotificationDisabled -Value 1 -PropertyType DWORD -Force |
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
$global:originalPSConsoleHostReadLine = $function:global:PSConsoleHostReadLine | |
$global:originalPrompt = $function:global:Prompt | |
$function:global:PSConsoleHostReadLine = { | |
$startProgressIndicator = "`e]9;4;3;50`e\" | |
$command = $originalPSConsoleHostReadLine.Invoke() | |
$startProgressIndicator | Write-Host -NoNewLine | |
$command | |
} |
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
# Do some work | |
Write-Host "Doing some work" | |
$job = Start-Job { | |
Start-Sleep -Seconds 5 | |
} | |
# Spinner | |
$location = $Host.UI.RawUI.CursorPosition | |
$spinnerIcons = @(". ", ".. ", "...") | |
$spinnerIconIndex = 0 |
NewerOlder