This file contains hidden or 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
[CmdletBinding()] | |
Param ( | |
[parameter(Mandatory = $False, ValueFromPipeline = $True, | |
HelpMessage = "wt settings file")] | |
[System.IO.FileInfo]$wtSettings = 'C:\Users\johnk\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json', | |
[parameter(Mandatory = $False, ValueFromPipeline = $False, | |
HelpMessage = "Name of file for update")] | |
[System.String]$wtRepoFile = "wt_settings_jkav.json", | |
[parameter(Mandatory = $False, ValueFromPipeline = $True, | |
HelpMessage = "Path to local clone")] |
This file contains hidden or 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
"Loading system functions" | |
. C:\etc\scripts\system-functions.ps1 | |
"Welcome to PowerShell on {0}" -f $psversiontable.Platform | |
Function test-onlineprof { | |
[CmdletBinding()] | |
Param ( | |
[parameter(Mandatory = $True, ValueFromPipeline = $False, | |
HelpMessage = "Url to profile gist")] | |
[System.String]$profOnline = 'https://gist.github.com/jkavanagh58/5e28bcb7475d714f564785bd15e5a120' | |
) |
This file contains hidden or 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
{ | |
"Day of Week Validated Parameter": { | |
"prefix": "DOWParam", | |
"body": [ | |
"[Parameter(Mandatory = $$true,\r", | |
"\tValueFromPipeline = $$true,\r", | |
"\tHelpMessage = \"${1:Enter Help Message Here}\")]\r", | |
"[ValidateSet('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday')]\r", | |
"[System.String]$${2:parametername}\r" | |
], |
This file contains hidden or 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
"Array List using Collection": { | |
"prefix": "collarray", | |
"body": [ | |
"# Create New Array\r", | |
"$${1:arrayName} = [System.Collections.ArrayList]@()\r", | |
"# Add items to array\r", | |
"$${1}.Add(\"${2:ItemValue}\") | Out-Null" | |
], | |
"description": "Form Array using .Net Collection" | |
} |
This file contains hidden or 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 CBH": { | |
"prefix": "PSFuncHelp", | |
"body": [ | |
"<#\r", | |
".SYNOPSIS\r", | |
"\tShort description", | |
".DESCRIPTION\r", | |
"\tLong description", | |
".PARAMETER Path\r", | |
"\tSpecifies a path to one or more locations.", |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Clean up PowerShell Installed Modules | |
.DESCRIPTION | |
Examine installed modules and determine versions that can be removed from installation folder. | |
.PARAMETER modInstalled | |
Collection of currently installed modules installed via PowerShellGet | |
.EXAMPLE | |
PS> ./uninstall-module-history.ps1 | |
Example of how to use this script |
This file contains hidden or 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
Find-Module -Tag PSEdtion_Desktop, PSEdition_Code |
This file contains hidden or 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
Find-Module -Tag PSEdtion_Desktop, PSEdition_Code |
This file contains hidden or 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
{ | |
"PS Custom Object": { | |
"prefix": "customobj", | |
"body": [ | |
"$$obj = [pscustomobject]@{", | |
"\t$FieldName = $FieldValue\r", | |
"}" | |
], | |
"description": "Skeleton for adding a PowerShell Custom Object" | |
}, |
This file contains hidden or 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 ImportExcel | |
$xlsxPath = "C:\Users\vndtekjxk\OneDrive - Wegmans Food Markets, Inc\Documents\SRM" | |
$xlsxName = "SRM1.xlsx" | |
$xlsxFile = Join-Path $xlsxPath -ChildPath $xlsxName | |
If (Test-Path $xlsxFile) { | |
$dataSet = Import-Excel -Path $xlsxFile -WorksheetName Sheet1 -DataOnly | |
$dataSet | Select-Object -Property Group -Unique | sort-object -Property Group | |
} |
NewerOlder