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://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json | |
# Reference: https://learn.microsoft.com/en-us/powershell/dsc/concepts/configurations?view=dsc-3.0#getting-the-current-state-of-a-configuration | |
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json | |
resources: | |
- type: Microsoft.DSC/PowerShell | |
name: Powershell DSC Resources | |
properties: | |
resources: | |
- type: Microsoft.WinGet.DSC/WinGetPackage | |
name: 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
$port = Get-Random -Min 4200 -Max 42000 | |
$JobName = "http://localhost:$($port)/" | |
$activitySource = New-ActivitySource -Name "littleweb" | |
New-TracerProviderBuilder | | |
Add-TracerSource -ActivitySource $activitySource | | |
Add-ResourceConfiguration -ServiceName $ExecutionContext.Host.Name -Attribute @{"host.name" = $(hostname); "host.port" = $port } | | |
Add-ExporterOtlpTrace -Endpoint http://localhost:4317 | | |
Add-ExporterConsole | |
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://learn.microsoft.com/en-us/windows/package-manager/configuration/ | |
properties: | |
resources: | |
- resource: Microsoft.WinGet.DSC/WinGetPackage | |
id: "Pwsh" | |
directives: | |
description: Install PowerShell 7 | |
allowPrerelease: true | |
settings: |
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
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
# 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 { |
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
# [CloudSmithClientPackagesGet]::new('stackoverflow','nuget').Invoke() | select Name, Version, Uploaded_At, Slug | |
class CloudSmithClient { | |
[string]$Namespace | |
[string]$Uri | |
[string]$Method | |
[string] hidden $ApiVersion = 'v1' | |
[string] hidden $Path | |
[hashtable] hidden $Headers = @{ } |
NewerOlder