Skip to content

Instantly share code, notes, and snippets.

@dsolodow
dsolodow / Get-WheelAnswer.ps1
Created November 20, 2018 19:04
Randomly select an IT pro answer.
Function Get-WheelAnswer
{
[string[]]$wheel = (
"No.",
"Are you sure it's plugged in?",
"Move... I'll do it",
"Yes, just click OK",
"No, it's a scam, just delete it",
"The problem is on your end.",
"Yes, it's gone forever, that's what empty trash does.",
# blank prompt
set fish_greeting
# Colors:
set fish_color_normal F8F8F2 # the default color
set fish_color_command F92672 # the color for commands
set fish_color_quote E6DB74 # the color for quoted blocks of text
set fish_color_redirection AE81FF # the color for IO redirections
set fish_color_end F8F8F2 # the color for process separators like ';' and '&'
set fish_color_error F8F8F2 --background=F92672 # the color used to highlight potential errors
@dsolodow
dsolodow / start-moduleCleanup.ps1
Created March 5, 2018 14:18
cleanup installed modules
Get-InstalledModule |
ForEach-Object {
$CurrentVersion = $PSItem.Version
Get-InstalledModule -Name $PSItem.Name -AllVersions |
Where-Object -Property Version -LT $CurrentVersion
} | Uninstall-Module -Verbose
@dsolodow
dsolodow / SCCM_ContentID.sql
Last active September 14, 2017 14:45
list packages, etc. with associated content id
use CM_PRI
SELECT LP.DisplayName,
CP.CI_ID,
CPS.PkgID,
CPS.ContentSubFolder
FROM dbo.CI_ContentPackages CPS
INNER JOIN dbo.CIContentPackage CP
ON CPS.PkgID = CP.PkgID
LEFT OUTER JOIN dbo.CI_LocalizedProperties LP
ON CP.CI_ID = LP.CI_ID
@dsolodow
dsolodow / Start-Elevated.ps1
Last active August 29, 2015 14:07
sudo for PowerShell
Function Start-Elevated {
[CmdletBinding()]
Param (
[parameter(Mandatory = $true,ValueFromPipeline=$true,Position=0)] [String]$FilePath,
[parameter(Mandatory = $false,ValueFromRemainingArguments=$true,Position=1)] [String[]]$ArgumentList
)
Start-Process -verb RunAs @PSBoundParameters
}
New-Alias -Name 'sudo' -Value 'Start-Elevated'