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 | |
#this requires a windows platform | |
Function prompt { | |
$charHash = @{ | |
Up = 0x25b2 -as [char] | |
Down = 0x25bc -as [char] | |
} |
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 6.1 | |
Function Send-ToPSGridView { | |
<# | |
.SYNOPSIS | |
Send objects to Out-Gridview in Windows PowerShell | |
.DESCRIPTION | |
This command is intended as a workaround for PowerShell Core running on a Windows platform, presumably Windows 10. PowerShell Core does not support all of the .NET Framework which means some commands like Out-Gridview are not supported. However, on a Windows desktop you are most likely running Windows PowerShell side by side with PowerShell Core. This command is designed to take objects from a PowerShell expression and send it to an instance of Windows PowerShell running Out-Gridview. You can specify a title and pass objects back to your PowerShell Core session. Note that passed objects will be deserialized versions of the original objects. | |
.PARAMETER Title |
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 3.0 | |
<# | |
Test-IsNanoServer.ps1 | |
**************************************************************** | |
* DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED * | |
* THOROUGHLY IN A LAB ENVIRONMENT. USE AT YOUR OWN RISK. IF * | |
* YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, * | |
* DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING. * |
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
<# | |
This may not work properly or completely in all PowerShell hosts. Because the function | |
relies on Get-CimInstance it will not work on Linux platforms. | |
It is also admittedly not speedy as it is doing a lot of stuff, although there is an | |
attempt to cache some information which gets updated every 15 minutes. | |
To use, dot source this script in your PowerShell profile to make it your default prompt. | |
Sample prompt: |
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 | |
<# | |
This is a variation of the BoxPrompt code you can find at https://gist.github.com/jdhitsolutions/df808116f9234c070bdaf233418ec59b | |
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] C:\ │ |
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
<# | |
Examples | |
PS C:\> c:\scripts\New-Thriller.ps1 | |
Open Source | |
----------- | |
by Jack Rollins | |
This exciting new tale from the author of 'Patch Tuesday' and 'The Game of Death', |
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
Function New-WindowsTerminalProfile { | |
[cmdletbinding(SupportsShouldProcess)] | |
Param( | |
[Parameter(Position = 0, Mandatory)] | |
[ValidateNotNullOrEmpty()] | |
[alias("name")] | |
[string]$ProfileName, | |
[Parameter( Mandatory)] | |
[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.1 | |
<# | |
The complete version of the function also requires additional modules | |
which can be downloaded from the PowerShell Gallery. | |
https://github.com/jdhitsolutions/PSCalendar | |
https://github.com/jdhitsolutions/myTickle | |
If you prefer to |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration> | |
<ViewDefinitions> | |
<View> | |
<!--Created 03/27/2019 17:01:10 by BOVINE320\Jeff--> | |
<Name>default</Name> | |
<ViewSelectedBy> | |
<TypeName>Get-DockerContainer.myDockerContainer</TypeName> | |
</ViewSelectedBy> | |
<GroupBy> |
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
Function Get-GitSize { | |
<# | |
.SYNOPSIS | |
Get the size of .git folder | |
.DESCRIPTION | |
When using git, it creates a hidden folder for change tracking. Because the file is hidden it is easy to overlook how large it might become. Specify the parent folder path. The result displays the size value in bytes but there are additional properties that show the value formatted in KB, MB or GB. | |
.PARAMETER Path | |
The path to the parent folder, not the .git folder. | |
.EXAMPLE | |
PS C:\scripts\PiedPiperBox> Get-GitSize |