Skip to content

Instantly share code, notes, and snippets.

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,
$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"
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' }
function Get-WeatherEmoji
{
[CmdletBinding()]
param
(
[string[]]$Condition,
[Boolean]$DayTime
)
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
Write-Host "`nI" -NoNewLine -ForegroundColor DarkGray
Write-Host " ❤ " -NoNewLine -ForegroundColor DarkRed
Write-Host "PS>" -NoNewLine -ForegroundColor DarkGray
@gerane
gerane / platyps.md
Last active July 8, 2016 18:36
Getting Started with PlatyPS

Getting started with PlatyPS

  • 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
{
"function": {
"prefix": "func",
"body": [
/* Test Comment*/
"function ${name:Verb-Noun}",
"{",
"\t[CmdletBinding()]",
"\tparam",
"\t(",
@gerane
gerane / EditorCommand.ps1
Created July 2, 2016 00:16
Place in Microsoft.VSCode_profile.ps1
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)
}

-ExtensionName

The Extensions Name. Accepts WildCards.

Type: String[]
Parameter Sets: ExtensionName
Aliases: 

Required: True
Position: Named