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 -Module NameIt, Humanizer | |
function New-Password { | |
[CmdletBinding(DefaultParameterSetName = 'Random')] | |
param ( | |
[Parameter(ParameterSetName = 'Random')] | |
[switch] | |
$Random, | |
[Parameter(ParameterSetName = 'Random')] | |
[switch] |
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
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 | |
# Reference: https://github.com/dotnet/aspnetcore/blob/main/docs/BuildFromSource.md | |
properties: | |
resources: | |
- resource: Microsoft.WinGet.DSC/WinGetPackage | |
directives: | |
description: Install PowerShell 7 | |
allowPrerelease: true | |
settings: | |
id: Microsoft.PowerShell |
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
<# | |
.SYNOPSIS | |
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager | |
.DESCRIPTION | |
This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The | |
Get-StoredCredential function can only access Generic Credentials. | |
Alias: GSC |
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 Convert-Base64 { | |
[CmdletBinding()] | |
[Alias("base64")] | |
param ( | |
[Parameter(Mandatory, Position = 0, ValueFromPipeline)] | |
[string] | |
$InputObject, | |
[Parameter()] | |
[switch] |
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
// <auto-generated> This file has been auto generated. </auto-generated> | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Globalization; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.Serialization; |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"background": "#26C6DA", | |
"foreground": "#011627", | |
"leading_diamond": "\u256d\u2500\ue0b6", |
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
{ | |
"console_title": true, | |
"blocks": [ | |
{ | |
"type": "newline" | |
}, | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"segments": [ |
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 Install-WinGet() { | |
Write-Information "[winget] Downloading Appx packages" | |
Push-Location $env:TEMP | |
# https://github.com/microsoft/winget-cli/issues/2230 | |
if (-not (Test-Path 'Microsoft.DesktopAppInstaller.msixbundle')) { | |
Write-Information "`tMicrosoft.DesktopAppInstaller" | |
Invoke-WebRequest 'https://aka.ms/getwinget' -OutFile 'Microsoft.DesktopAppInstaller.msixbundle' -UseBasicParsing |
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 map([scriptblock]$map, [Collections.IEnumerable]$x, $y) { $x.ForEach({& $map $_ $y}) } | |
# Two parameters | |
map { param($x, $y) $x + $y } @(1,2,3) 10 | |
# Anonymous function as a value | |
$squareIt = { param($x) $x + $x } | |
map $squareIt @(1,2,3) | |
# One parameter |
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
# I don't want to install Python so this docker image and Pwsh function mimic a binary | |
<# Dockerfile | |
FROM python:3-alpine | |
RUN pip install --upgrade cloudsmith-cli | |
WORKDIR /working | |
ENTRYPOINT ["cloudsmith"] | |
#> | |
function cloudsmith { |
NewerOlder