Skip to content

Instantly share code, notes, and snippets.

View mikefrobbins's full-sized avatar

Mike F. Robbins mikefrobbins

View GitHub Profile
@mikefrobbins
mikefrobbins / gist:8d2e208f6a5729d1cf90a052eaa1d443
Last active December 15, 2024 06:11
Select and open PowerShell podcast episode webpage with PowerShell
# Install the Microsoft.PowerShell.ConsoleGuiTools module
Install-Module -Name Microsoft.PowerShell.ConsoleGuiTools
# Select and open PowerShell podcast episode webpage with PowerShell
Invoke-RestMethod -Uri https://feed.podbean.com/powershellpodcast/feed.xml |
Select-Object -Property @{
label='title';expression={$_.title[0]}}, @{
label='date';expression={Get-Date -Date $_.pubDate -Format d}},
duration,
link |
@mikefrobbins
mikefrobbins / Test-IsWindowsTerminal.ps1
Created May 15, 2024 22:17
Determine if the host is Windows Terminal
function Test-IsWindowsTerminal {
[CmdletBinding()]
param ()
# Check if PowerShell version is 5.1 or below, or if running on Windows
if ($PSVersionTable.PSVersion.Major -le 5 -or $IsWindows -eq $true) {
$currentPid = $PID
# Loop through parent processes to check if Windows Terminal is in the hierarchy
while ($currentPid) {
@mikefrobbins
mikefrobbins / gist:73757ca0c9c098d02e0758921a0d48d0
Last active October 2, 2023 12:44
Status of Azure VM Image
<#
Prerequisites
An Azure subscription is required.
Install the Az PowerShell module from the PowerShell Gallery:
Install-Module -Name Az
Login to Azure:
Connect-AzAccount
#>
@mikefrobbins
mikefrobbins / Disable-OnThisDayPhotoNotification.ps1
Last active August 3, 2023 18:48
Disable-OnThisDayPhotoNotification
# 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
@mikefrobbins
mikefrobbins / Compare-Module.ps1
Created July 31, 2023 21:33 — forked from jdhitsolutions/Compare-Module.ps1
Use this command to compare module versions between what is installed against an online repository like the PSGallery. Results will be automatically sorted by module name.
#requires -version 5.0
# https://gist.github.com/jdhitsolutions/7217ed9293f18e8d454e3f88ecb38b67
Function Compare-Module {
<#
.Synopsis
Compare module versions.
.Description
Use this command to compare module versions between what is installed against an online repository like the PSGallery. Results will be automatically sorted by module name.
@mikefrobbins
mikefrobbins / vscode-enable-github-copilot-tab-completion.md
Last active May 25, 2023 19:10
Enable tab completion for GitHub Copilot suggestions in VS Code

From VS Code, press F1 or Ctrl + Shift + P. Type "Open Keyboard Shortcuts (JSON)". Add the following to keybindings.json:

[
  {
    "key": "tab",
    "command": "editor.action.inlineSuggest.commit",
    "when": "textInputFocus && inlineSuggestionHasIndentationLessThanTabSize && inlineSuggestionVisible && !editorTabMovesFocus"     
  }
]
@mikefrobbins
mikefrobbins / profile.ps1
Created September 20, 2022 20:51 — forked from SteveL-MSFT/profile.ps1
PowerShell Prompt
#Requires -Version 7
# Version 1.2.12
# check if newer version
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e"
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version')
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)"
if ([System.IO.File]::Exists($latestVersionFile)) {