Skip to content

Instantly share code, notes, and snippets.

View Windos's full-sized avatar

Josh King Windos

View GitHub Profile
@michaeltlombardi
michaeltlombardi / profile_helpers.ps1
Last active December 11, 2023 13:14
Cross Platform theming and prompt built on FiraCode, Monokai, and Starship
#region Custom Function Definitions
Function Test-Administrator {
$CurrentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
$AdministratorRole = [Security.Principal.WindowsBuiltInRole] "Administrator"
([Security.Principal.WindowsPrincipal]$CurrentUser).IsInRole($AdministratorRole)
}
#endregion
#region Prompt Prep
# Set ENV for elevated status
@potatoqualitee
potatoqualitee / gallery.ps1
Created February 2, 2019 13:04
deployment script
@brettmillerb
brettmillerb / profile.ps1
Last active October 18, 2019 10:30
Powershell Profile
# Import Mandatory Modules
Import-Module -Name Toolbox
Import-Module posh-git
# function declarations
function Open-Here { explorer $pwd }
function Set-SupportPath { Set-Location C:\support }
function Set-DocsPath { Set-Location $env:OneDrive\documents }
function Set-HomePath { Set-Location $home }
function Set-GitPath { Set-Location C:\support\git }
@brettmillerb
brettmillerb / O365-Snippet.json
Created July 23, 2018 14:12
O365 License VSCode Snippet
"365-LicenseObject": {
"prefix": "O365-LicenseObject",
"body": [
"\\$enabledplans = 'SHAREPOINTWAC','YAMMER_ENTERPRISE','SHAREPOINTSTANDARD'",
"",
"#Get the licensesku and create the Disabled ServicePlans object",
"\\$licensesku = Get-AzureADSubscribedSku | Where-Object {\\$_.SkuPartNumber -eq '${License}'} ",
"\r",
"#Loop through all the individual plans and disable all plans except the one in \\$enabledplans",
"\\$disabledplans = \\$licensesku.ServicePlans | ForEach-Object -Process { ",
@IISResetMe
IISResetMe / Install-ModuleProxy.ps1
Created July 5, 2018 02:48
Install-Module with a compulsory clobber check
[CmdletBinding(DefaultParameterSetName='NameParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium', HelpUri='https://go.microsoft.com/fwlink/?LinkID=398573')]
param(
[Parameter(ParameterSetName='NameParameterSet', Mandatory=$true, Position=0, ValueFromPipelineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[string[]]
${Name},
[Parameter(ParameterSetName='InputObject', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
[ValidateNotNull()]
[psobject[]]
@Jaykul
Jaykul / Demo.ps1
Last active March 13, 2018 00:18
PowerLines - a better way to build a prompt function
## TODO: Make this a ReadMe.
## In the meantime, this is a series of lines meant to be typed into a PowerShell host as a demo:
# dull prompt
ipmo Powerline; Set-PowerlinePrompt
$function:prompt
# That's a little prettier ...
pushd .\Documents\WindowsPowerShell\
# Oh, I want to see the location stack size
Get-Location -Stack
using module .\SevOne.psm1
[SevOne.device]
[SevOne.something]