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
| param( | |
| [parameter()] | |
| [string] | |
| $org = 'PowerShell' | |
| ) | |
| # PowerShell Team members | |
| $exclude = @( | |
| 'adityapatwardhan' | |
| 'alerickson' |
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
| param( | |
| [parameter(Mandatory)] | |
| $user, | |
| [System.Management.Automation.SwitchParameter] | |
| $delete, | |
| [string] | |
| $yourUsername, |
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-SuspiciousElement { | |
| param ( [scriptblock]$sb, [switch]$InPlace ) | |
| $susProp = $sb.ast.gettype().GetProperty("HasSuspiciousContent", [reflection.bindingflags]"NonPublic,Instance") | |
| $suspiciousContent = "" | |
| $sb.Ast.FindAll({$true}, $true) | %{ | |
| if ( $susProp.GetValue($_) ) { | |
| $suspiciousContent = $_.Extent.Text | |
| } |
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
| $ExecutionContext.InvokeCommand.CommandNotFoundAction = | |
| { | |
| param( | |
| [string] | |
| $commandName, | |
| [System.Management.Automation.CommandLookupEventArgs] | |
| $eventArgs | |
| ) | |
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
| param( | |
| [string]$include = "*.resx" | |
| ) | |
| $filesToExclude = @( | |
| 'FlashExtractStrings.resx' | |
| '*Xaml*.resx' | |
| 'TabCompletionStrings.resx' | |
| '*UICultureResources.resx' | |
| 'ComputerResources.resx' |
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-progress -id 1 -Activity "Getting all modules" | |
| $modules = find-module -Repository PSGallery | |
| $moduleNames = $modules.Name | |
| $fz = [System.Reflection.Assembly]::GetAssembly([System.Management.Automation.PowerShell]).GetType("System.Management.Automation.FuzzyMatcher") | |
| $fzmatch = $fz.GetMethod("GetDamerauLevenshteinDistance") | |
| $fzmatches = @{} | |
| $i = 1 | |
| foreach ($module in $moduleNames) { | |
| write-progress -id 1 -Activity "Searching" -Status "$module" -PercentComplete ([int32]([double]$i / [double]($moduleNames.Count) * 100)) |
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=$true,Position=0)] | |
| [string]$command, | |
| [Parameter(Position=1)] | |
| [string]$class | |
| ) | |
| if ($command -eq 'path') { |
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
| using System; | |
| using System.Management.Automation; | |
| using System.Text; | |
| namespace ClipboardReverse | |
| { | |
| [Cmdlet(VerbsCommon.Get,"ClipboardReverse")] | |
| [OutputType(typeof(string))] | |
| public class ClipboardReverse : PSCmdlet | |
| { |
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 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
| [31mhello [32mworld | |
| ]633;Completions? |
NewerOlder