It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
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
| Add-Type @" | |
| using System; | |
| using System.Runtime.InteropServices; | |
| public class NativeConsoleMethods | |
| { | |
| [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | |
| public static extern IntPtr GetStdHandle(int handleId); |
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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <!-- ******************************************************************* | |
| This is Joel "Jaykul" Bennett's coloring format file for PowerShell 5.1 | |
| ******************************************************************** --> | |
| <Configuration> | |
| <SelectionSets> | |
| <SelectionSet> | |
| <Name>FileSystemTypes</Name> | |
| <Types> | |
| <TypeName>System.IO.DirectoryInfo</TypeName> |
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
| // Place your key bindings in this file to overwrite the defaults | |
| [ | |
| { "key": "alt+n", "command": "explorer.newFile" }, | |
| { "key": "alt+shift+s", "command": "PowerShell.InvokeRegisteredEditorCommand", | |
| "args": { "commandName": "ConvertToSplatExpression" }, | |
| "when": "editorLangId == 'powershell'" }, | |
| { "key": "ctrl+shift+q", "command": "workbench.action.toggleMaximizedPanel" }, | |
| { "key": "ctrl+shift+s", "command": "workbench.action.files.saveAll" }, | |
| { "key": "ctrl+shift+t", "command": "workbench.action.tasks.test" }, | |
| { "key": "ctrl+alt+t", "command": "workbench.action.tasks.runTask" }, |
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
| 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) |
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-AzureTemplate { | |
| param( | |
| $pattern, | |
| [Switch]$Force | |
| ) | |
| if(!$global:AzureTemplates -or $Force) { | |
| $url="https://api.github.com/repos/Azure/azure-quickstart-templates/git/trees/master" | |
| $global:AzureTemplates=(irm $url).tree | ?{$_.type -eq "tree"} | |
| } |
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
| # This is a PSake script that supports the following tasks: | |
| # clean, build, test and publish. The default task is build. | |
| # | |
| # The publish task uses the Publish-Module command to publish | |
| # to either the PowerShell Gallery (the default) or you can change | |
| # the $Repository property to the name of an alternate repository. | |
| # | |
| # The test task invokes Pester to run any Pester tests in your | |
| # workspace folder. Name your test scripts <TestName>.Tests.ps1 | |
| # and Pester will find and run the tests contained in the files. |
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-PSGalleryInfo { | |
| param( | |
| [Parameter(ValueFromPipelineByPropertyName=$true)] | |
| $Name | |
| ) | |
| Begin { | |
| $t = @" | |
| {Name*:PowerShellISE-preview} {[version]Version:5.1.0.1} (this version) {[double]Downloads:885} {[DateTime]PublishDate:Wednesday, January 27 2016} | |
| {Name*:ImportExcel} 1.97 {Downloads:106} Monday, January 18 2016 | |
| "@ |
This article has been updated and is available here.
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
| describe "DS"{ | |
| it "skipped" {} -skip | |
| it "pending" {} -Pending | |
| It "throw" { throw "sdfad" } | |
| It "assertion fail" {1 | should be 10 } | |
| It "string assertion fail" {"asdf" | should be "ffsad" } | |
| it "success" {"adsf"} | |
| } |