{ claus.conrad }

Chocolatey

https://chocolatey.org/

Notes

apt-like package installer for [Windows](…/Microsoft Windows/) with a community repository and a commercial on-premises solution

Resources

FAQ

Back up list of installed apps

C:\ProgramData\chocolatey\bin\choco.exe list -li > C:\Users\mail\OneDrive\Backup\claus10\chocolatey\$(date -Format "yyyyMMdd").txt

Automate the backup using a scheduled task

Save the code above in a script file. Adjust the paths (to the script and target directory) below. Run these commands to register a scheduled task.

$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-WindowStyle Hidden C:\Users\mail\Sites\administration\backup\claus10-chocolatey.ps1"

$trigger = New-ScheduledTaskTrigger -Daily -At '20:20'

$settings = New-ScheduledTaskSettingsSet -RunOnlyIfNetworkAvailable -MultipleInstances IgnoreNew -ExecutionTimeLimit (New-Timespan -Minutes 1)

$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings -Description "Back up list of installed apps"

Register-ScheduledTask -TaskName "Backup Chocolatey" -InputObject $task

Maintain Windows packages from Linux

podman run --rm -it -v .:/root:z docker.io/chocolatey/choco:latest choco pack
podman run --rm -it -v .:/root:z docker.io/chocolatey/choco:latest choco push -s https://push.chocolatey.org/ --api-key API_KEY

Creating a GCP VM for testing installations

gcloud compute instances create choco-xmind-2020 --project=api-project-542389980451 --zone=europe-north1-c --machine-type=e2-standard-2 --network-interface=network-tier=STANDARD,stack-type=IPV4_ONLY,subnet=default --no-restart-on-failure --maintenance-policy=TERMINATE --provisioning-model=SPOT --instance-termination-action=DELETE --max-run-duration=3600s --no-service-account --no-scopes --create-disk=auto-delete=yes,boot=yes,device-name=choco-xmind-2020,image=projects/windows-cloud/global/images/windows-server-2022-dc-v20240819,mode=rw,size=50,type=pd-balanced --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --labels=goog-ec-src=vm_add-gcloud --reservation-affinity=any