Skip to content

Instantly share code, notes, and snippets.

Import-Module -Name Emojis
function Invoke-EmojiSelection {
param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context)
$EmojiText = $context.CurrentFile.GetText($context.SelectedRange)
$Emoji = Get-Emoji -Name $EmojiText
if ($Emoji)
{
$context.CurrentFile.InsertText($Emoji, $context.SelectedRange)
Import-Module -Name Emojis
function Invoke-Emoji {
$context = $psEditor.GetEditorContext()
$EmojiText = $context.CurrentFile.GetTextLines($context.SelectedRange)
$Emoji = Get-Emoji -Name $EmojiText
if ($Emoji)
{
$context.CurrentFile.InsertText($Emoji, $context.SelectedRange)
function Get-CommandChoice
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)]
[Array]$Array,
[Parameter(Mandatory=$true)]
[string]$caption,
function Invoke-TestCommand {
$Extensions = Get-Childitem -path "$Env:USERPROFILE\.vscode-insiders\extensions\gerane*" -Directory
$caption = "Please select a an Extension"
$message = "Package.json will be launched"
[int]$defaultChoice = 0
$Choices = [System.Management.Automation.Host.ChoiceDescription[]] @($Extensions.Name)
$TestParam = $host.ui.PromptForChoice($caption,$message, $choices,$defaultChoice)
$ExtDir = $Extensions[$TestParam].FullName
function Test-ParameterSet
{
[CmdletBinding(DefaultParameterSetName = 'Default')]
[OutputType([boolean], ParameterSetName = 'Test')]
[OutputType([PSObject], ParameterSetName = 'Default')]
param
(
[parameter(Mandatory = $true)]
[System.String]$Param1,
@gerane
gerane / Test-EventLogExists.Tests.ps1
Created April 7, 2016 16:52
Learning Pester and better comment based Help. Please leave feedback if you have any suggestions!
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace('.Tests.', '.')
. "$here\$sut"
Remove-EventLog -LogName Pester -ErrorAction SilentlyContinue
Describe 'Test-EventLogExists' {
Set-StrictMode -Version latest
function Get-RickRoll
{
[CmdletBinding()]
param()
DynamicParam
{
$ParameterName = 'Name'
$RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary
@gerane
gerane / nxlog.conf
Created February 25, 2016 00:46 — forked from chelming/nxlog.conf
NXLOG config that will parse SCCM and IIS logs
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
define CERTDIR %ROOT%\cert
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid