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
| #!/usr/bin/perl | |
| # Author: Todd Larason <[email protected]> | |
| # $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $ | |
| # use the resources for colors 0-15 - usually more-or-less a | |
| # reproduction of the standard ANSI colors, but possibly more | |
| # pleasing shades | |
| # colors 16-231 are a 6x6x6 color cube | |
| for ($red = 0; $red < 6; $red++) { |
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:Get-CompFolder{ | |
| param($iFolderLoc) | |
| $objCompFolder = [Ordered]@{ | |
| 'Location' = $iFolderLoc | |
| 'Folder' = Get-Item $iFolderLoc | |
| 'SortedTree' = @() | |
| } | |
| New-Object -TypeName PSObject -Property $objCompFolder | | |
| Add-Member -Passthru -Type ScriptProperty -Name Tree -Value { |
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
| param( | |
| $Source = "c:\users\USER1\desktop\test\folder1", | |
| $Destination = "c:\users\USER1\desktop\test\folder2" | |
| ) | |
| $Sources = Get-ChildItem $Source -recurse -depth 4 | Where-Object {$_.name -like "*``, *`` *``(*2016)"} | Select-Object -ExpandProperty FullName | |
| Push-Location $Source | |
| foreach($SourcePath in $Sources) { | |
| $DestPath = Join-Path $Destination (Resolve-Path $SourcePath -Relative) |
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 "D:\Coding\PowerShell\Modules\remove-OldFiles.psm1" | |
| remove-OldFiles -Path 'D:\Coding' -ExcludeFolders "Bootstrap Learning","PowerShell","Waaah!" | |
| #the folder Waaah! dont exists in the Folder mentioned above. so in the PSM there is a write-Host line to display this error. but i dont see it when i call the function from the ps1 script. |
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
| Show-UI -Title 'FTP Log Search' { | |
| Grid -Columns Auto,* -Rows 5 -Margin 5 -MinHeight 200 -MinWidth 250 { | |
| Label "Date (MM/DD/YY)" | |
| New-DatePicker -Name First -Column 1 -Margin "5" | |
| Label "Clip Name" -Row 1 | |
| New-TextBox -Name Last -Row 1 -Column 1 -Margin "5" | |
| Label "E-mail Address" -Row 2 |
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 New-SelfCleaningJob { | |
| param( | |
| $Name=$([Guid]::NewGuid().Guid) | |
| ) | |
| $job = Start-Job -Name $Name { 1..10 | % { Write-Output $_ } } | |
| $jobCleanup = Register-ObjectEvent $job -EventName StateChanged -Action { | |
| if($EventArgs.JobStateInfo.State -eq "Completed") { | |
| # Note this prints to host no matter what's going on right now .... | |
| Receive-Job $Sender | out-host |
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-Data { | |
| Param ( | |
| [Parameter()][int]$MajorVersion = $(([environment]::OSVersion.Version).Major), | |
| [Parameter()][int]$MinorVersion = $(([environment]::OSVersion.Version).Minor), | |
| [Parameter()][string]$Find = "wcPatchUri" | |
| ) | |
| Process{ | |
| Try{ | |
| $cdnBaseURI = "https://example.com" |
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 namespace System.Management.Automation | |
| using namespace System.Collections.Generic | |
| class ArgumentCompleterBase : IArgumentCompleter { | |
| hidden [List[CompletionResult]] $Results = [List[CompletionResult]]::new() | |
| [string] $WordToComplete | |
| [Language.CommandAst] $commandAst | |
| # override in child class | |
| [void] AddCompletionsFor([string] $commandName, [string] $parameterName, [Collections.IDictionary] $fakeBoundParameters) {} |
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 New-Hyperlink { | |
| <# | |
| .SYNOPSIS | |
| Creates a VT Hyperlink in a supported terminal such as Windows Terminal 1.4+ | |
| .NOTES | |
| There's a more powerful version of this, with color support and more, in PANSIES | |
| .EXAMPLE | |
| New-Hyperlink https://github.com/Jaykul/PANSIES PANSIES | |
| Creates a hyperlink with the text PANSIES which links to the github project |
OlderNewer