- Start by importing most recent version of module
- I try to fill in as much information as possible in my parameter attributes before creating my innitial markdown. Having all of these filled out helps when using PlatyPS in place of comment based help. PlatyPS still has a few issues with some attributes when using
Update-MarkdownHelp
try to fill in all attribute like the following.- [SupportsWildcards()]
- [PSDefaultValue(Help='whatever the default value is')]
- [OutputType([if there is an outputtype])]
- [CmdletBinding()]
- [Alias()]
- DefaultParameterSetName=""
- SupportsShouldProcess
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 Find-PlasterTemplate { | |
[CmdletBinding(DefaultParameterSetName='Default')] | |
[OutputType("PSCustomObject[]")] | |
param( | |
[Parameter(HelpMessage="Specifies the Name of the Plaster template to find", | |
ValueFromPipelineByPropertyName=$true, | |
Position=0)] | |
[ValidateNotNullOrEmpty()] | |
[string[]] | |
$Name, |
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
$loadInf = '@ | |
[Setup] | |
Lang=english | |
Dir=C:\Program Files (x86)\Microsoft VS Code Insiders | |
Group=Visual Studio Code Insiders | |
NoIcons=0 | |
Tasks=desktopicon,addcontextmenufiles,addcontextmenufolders,addtopath | |
@' | |
$exePath = "${env:TEMP}\Insiders.exe" |
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
if ($Alert -ne $null) | |
{ | |
$Env:WeatherAlert = $Alert | |
switch ($Alert.type) | |
{ | |
'HUR' { $AlertType = 'Hurricane Local Statement' } | |
'TOR' { $AlertType = 'Tornado Warning' } | |
'TOW' { $AlertType = 'Tornado Watch' } | |
'WRN' { $AlertType = 'Severe Thunderstorm Warning' } | |
'SEW' { $AlertType = 'Severe Thunderstorm Watch' } |
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 Get-WeatherEmoji | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[string[]]$Condition, | |
[Boolean]$DayTime | |
) |
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 global:prompt | |
{ | |
$realLASTEXITCODE = $LASTEXITCODE | |
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor | |
$Host.UI.RawUI.ForegroundColor = "White" | |
Write-Host $PWD.ProviderPath -NoNewLine -ForegroundColor Green | |
Write-VcsStatus | |
$global:LASTEXITCODE = $realLASTEXITCODE |
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
Write-Host "`nI" -NoNewLine -ForegroundColor DarkGray | |
Write-Host " ❤ " -NoNewLine -ForegroundColor DarkRed | |
Write-Host "PS>" -NoNewLine -ForegroundColor DarkGray |
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": { | |
"prefix": "func", | |
"body": [ | |
/* Test Comment*/ | |
"function ${name:Verb-Noun}", | |
"{", | |
"\t[CmdletBinding()]", | |
"\tparam", | |
"\t(", |
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
Register-EditorCommand ` | |
-Name 'ToDo.InsertToDo' ` | |
-DisplayName 'Insert ToDo' ` | |
-SuppressOutput ` | |
-ScriptBlock { | |
param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context) | |
$Message = Read-Host 'Please enter Todo Message' | |
$ToDo = "# [$((Get-Date).ToShortDateString())] ToDo: $($Message)" | |
$context.CurrentFile.InsertText($ToDo, $context.CursorPosition) | |
} |