Skip to content

Instantly share code, notes, and snippets.

View Trenly's full-sized avatar

Kaleb Luedtke Trenly

View GitHub Profile
@Trenly
Trenly / Get-UrlResponse.ps1
Created August 12, 2022 17:39
Get-UrlResponse PowerShellSnippet
Function Get-UrlResponse {
Param
(
[Parameter(Mandatory = $true, Position = 0)]
[string] $URL
)
try {
$HTTP_Request = [System.Net.WebRequest]::Create($URL)
$HTTP_Request.UserAgent = 'Microsoft-Delivery-Optimization/10.1'
$HTTP_Response = $HTTP_Request.GetResponse()
@Trenly
Trenly / README.md
Last active June 15, 2024 17:40
Install Winget to the Windows Sandbox Base Image

This powershell script modifies the Base Image, or the Virtual Hard Disk, which the Windows Sandbox launches upon startup. It will copy the required files to the sandbox and add a registry key which will install them upon startup. By default the script will install the latest stable release of Winget. You can specify to use the latest pre-release with the -PreRelease switch.

When a new version of Winget is released, run this script again to update the installation in the sandbox to the latest version