Skip to content

Instantly share code, notes, and snippets.

View jwmoss's full-sized avatar
🤩
Stuck in a foreach loop

Jonathan Moss jwmoss

🤩
Stuck in a foreach loop
View GitHub Profile
@jwmoss
jwmoss / Set-WindowState.ps1
Last active October 8, 2025 22:14 — forked from lalibi/Set-WindowState.ps1
Hide, Show, Minimize, Maximize, etc window from Powershell.
function Set-WindowState {
<#
.SYNOPSIS
Set the state of a window.
.DESCRIPTION
Set the state of a window using the `ShowWindowAsync` function from `user32.dll`.
.PARAMETER InputObject
The process object(s) to set the state of. Can be piped from `Get-Process`.
Write-host "test!"
$null = New-Item -Name 'Tests' -Path C:/ -Type Directory -Force
$null = New-Item -Name 'Config' -Path C:/ -Type Directory -Force
@jwmoss
jwmoss / speed_d.ps1
Last active August 14, 2025 20:13
speed d drive
# Test C: drive speed with DiskSpd (fixed arg passing)
# --- Settings ---
$diskspdUrl = "https://github.com/microsoft/diskspd/releases/download/v2.2/DiskSpd.ZIP"
$diskspdExe = "$env:TEMP\diskspd.exe"
$tempFile = "D:\diskspd_testfile.dat" # test file now on D:
$outFile = "$env:TEMP\diskspd_results.txt"
$fileSize = "1G" # test file size
$duration = 30 # seconds
@jwmoss
jwmoss / speed.ps1
Last active August 14, 2025 19:29
test disk speed on windows
# Test C: drive speed with DiskSpd (fixed arg passing)
# --- Settings ---
$diskspdUrl = "https://github.com/microsoft/diskspd/releases/download/v2.2/DiskSpd.ZIP"
$diskspdExe = "$env:TEMP\diskspd.exe"
$tempFile = "$env:TEMP\diskspd_testfile.dat"
$outFile = "$env:TEMP\diskspd_results.txt"
$fileSize = "1G" # test file size
$duration = 30 # seconds
This file has been truncated, but you can view the full file.
#!ipxe
goto ${vendor}${device} || goto ${vendor} || exit
:0001
set ven SafeNet (wrong ID)
exit
:0010
set ven Allied Telesis, Inc (Wrong ID)
exit
:00108139
set dev AT-2500TX V3 Ethernet
This file has been truncated, but you can view the full file.
#!ipxe
goto ${vendor}${device} || goto ${vendor} || exit
:0001
set ven SafeNet (wrong ID)
exit
:0010
set ven Allied Telesis, Inc (Wrong ID)
exit
:00108139
set dev AT-2500TX V3 Ethernet
{
"accessToken": "foo",
"cachesDir": "D:\\caches",
"certificate": "{\"version\":1,\"scopes\":[\"assume:worker-type:gecko-t/win11-64-24h2\",\"assume:worker-pool:gecko-t/win11-64-24h2\",\"assume:worker-id:westus2/vm-a0hfdezotl6uwzmbowqs6qpqir8wn3spu2u\",\"queue:worker-id:westus2/vm-a0hfdezotl6uwzmbowqs6qpqir8wn3spu2u\",\"secrets:get:worker-type:gecko-t/win11-64-24h2\",\"secrets:get:worker-pool:gecko-t/win11-64-24h2\",\"queue:claim-work:gecko-t/win11-64-24h2\",\"worker-manager:remove-worker:gecko-t/win11-64-24h2/westus2/vm-a0hfdezotl6uwzmbowqs6qpqir8wn3spu2u\",\"worker-manager:reregister-worker:gecko-t/win11-64-24h2/westus2/vm-a0hfdezotl6uwzmbowqs6qpqir8wn3spu2u\"],\"start\":1752760271626,\"expiry\":1753106771595,\"seed\":\"pMWlbm1WS7mVAhiG18UonwUHNbU6s8T0emK1fGf-G4Vw\",\"signature\":\"u6VasRbkTO8RPb8HfEbY89V3vpwyNAYEQ3P9G1mopPw=\",\"issuer\":\"static/taskcluster/worker-manager\"}",
"cleanUpTaskDirs": true,
"clientId": "worker/azure2/gecko-t/win11-64-24h2/westus2/vm-a0hfdezotl6uwzmbowqs6qpqir8wn3spu2u"
@jwmoss
jwmoss / parse_task.py
Created October 24, 2024 18:18
parse_task
# pip install mozci
# pip install zstandard
import requests
import sys
from mozci.util.taskcluster import get_task
#input_task_id = "OkI2h843RBGsyOzo5NH1Dg"
input_task_id = sys.argv[1]
@jwmoss
jwmoss / oobe_24h2.ps1
Created October 3, 2024 21:01
oobe_24h2
@(
"HideEULAPage",
"HideLocalAccountScreen",
"HideOEMRegistrationScreen",
"HideOnlineAccountScreens",
"HideWirelessSetupInOOBE",
"NetworkLocation",
"OEMAppId",
"ProtectYourPC",
"SkipMachineOOBE",
@jwmoss
jwmoss / afaddin.ps1
Last active August 9, 2024 19:18
afaddin
# Define the software to uninstall and the new software to install
$softwareToUninstall = "AdvanceFlow Addin"
$newSoftwareInstallerPath = "./ps1"
$newSoftwareInstallArguments = "/i /qn"
# Function to uninstall the old software
function Uninstall-Software {
param (
[string]$softwareName
)