This file contains 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
#requires -version 4.0 | |
#dot source the script with the New-GitHubGist function | |
. C:\scripts\New-GitHubGist.ps1 | |
Function SendTo-Gist { | |
[cmdletbinding()] | |
Param( | |
[Parameter(Position = 0)] | |
[ValidateNotNullorEmpty()] |
This file contains 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
#requires -version 5.0 | |
Function Test-Me { | |
[cmdletbinding()] | |
Param() | |
Write-Information "Starting $($MyInvocation.MyCommand) " -Tags Process | |
Write-Information "PSVersion = $($PSVersionTable.PSVersion)" -Tags Meta | |
Write-Information "OS = $((Get-CimInstance Win32_operatingsystem).Caption)" -Tags Meta |
This file contains 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
#requires -version 4.0 | |
Function New-GitHubGist { | |
[cmdletbinding(SupportsShouldProcess,DefaultParameterSetName = "Content")] | |
Param( | |
[Parameter(Position = 0, Mandatory, HelpMessage = "What is the name for your gist?",ValueFromPipelineByPropertyName)] | |
[ValidateNotNullorEmpty()] | |
[string]$Name, |
This file contains 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
#requires -version 5.1 | |
<# | |
Create a lined box with user and location information. The line color will indicate if the user is running elevated. | |
The prompt will also display the current date and time and a PS prompt with the PowerShell version. | |
┌─────────────────────────┐ | |
│ [BOVINE320\Jeff] D:\iso │ | |
└─────────────────────────┘ | |
[01/18/2019 09:30:53] PS v6.1.2> |
This file contains 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
Enum BookCategory { | |
GeneralFiction | |
Horror | |
Romance | |
Literary | |
Mystery | |
Thriller | |
ScienceFiction | |
NonFiction |
This file contains 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
#requires -version 4.0 | |
<# | |
get current entries in the PlanetPowerShell RSS feed | |
Because of the way entries are syndicated not every feed item | |
will parse cleanly or with information. | |
#> | |
[cmdletbinding()] | |
Param() |
This file contains 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()] | |
[outputtype("moduleInfo")] | |
Param( | |
[Parameter(Position = 0, HelpMessage = "Enter a module name or names. Wildcards are allowed.")] | |
[ValidateNotNullorEmpty()] | |
[string[]]$Name = "*" | |
) | |
Write-Verbose "Getting installed modules" | |
Try { |
This file contains 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 a border around a string of text | |
Function Add-Border { | |
<# | |
.Synopsis | |
Create a text border around a string. | |
.Description | |
This command will create a character or text based border around a line of text. You might use this to create a formatted text report or to improve the display of information to the screen. |
This file contains 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
#requires -version 4.0 | |
Function Get-CimNamespace { | |
[cmdletbinding(DefaultParameterSetName = 'computer')] | |
Param( | |
[Parameter(Position=0)] | |
[ValidateNotNullorEmpty()] | |
[string]$Namespace = "Root", | |
[Parameter(ParameterSetName = 'computer')] | |
[ValidateNotNullorEmpty()] |
This file contains 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
#Requires -version 4.0 | |
<# | |
This is a script but it supports -Whatif and accepts parameters. | |
#> | |
[cmdletbinding(SupportsShouldProcess)] | |
Param ( | |
[Parameter(Position = 0, HelpMessage = "Enter the path where you want to save the downloads")] |