Skip to content

Instantly share code, notes, and snippets.

@free-pmx
free-pmx / post-install-scripts.rst
Last active November 26, 2025 19:12

The pitfalls of some post-install scripts

Be aware of security implications that come with third-party setup tools, such as those supplied by the wider community.


See maintained post: https://free-pmx.org/insights/post-install-scripts/

NOTE No tracking on the site. Full and current reStructuredText version linked from within.

@juliusl
juliusl / cloud-init-hyperv.ps1
Created January 13, 2023 19:12
Cloud Init Hyper-V
$tempPath = [System.IO.Path]::GetTempPath() + [System.Guid]::NewGuid().ToString()
# ADK Download - https://www.microsoft.com/en-us/download/confirmation.aspx?id=39982
# You only need to install the deployment tools
$oscdimgPath = "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe"
# Download qemu-img from here: http://www.cloudbase.it/qemu-img-windows/
$qemuImgPath = "E:\backbonev2\lib\bin\qemu-img-win-x64-2_3_0\qemu-img.exe"
# Update this to the release of Ubuntu that you want
@bitroniq
bitroniq / Converting-qcow2-to-vmdk-and-vhdx.md
Last active December 5, 2025 12:19
Converting images with qemu-img convert

VM images

vGateway images extensions

  • .qcow2 - KVM type Virtual Machines
  • .vmdk - VMware and VirtualBox and ESXi
  • .vdi - VirtualBox
  • .vhdx - Microsoft Hyper-V
  • .vhd - Azure requires fixed size
@jborean93
jborean93 / Get-WindowsUpdate.ps1
Last active May 15, 2025 21:34
Output a list of updates based on the criteria that you define
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
Function Write-WUAError {
<#
.SYNOPSIS
Convert raw HRESULT codes to a human readable error.
.PARAMETER Exception
The COMException that the error code is from.
@azurekid
azurekid / get-extensions.ps1
Last active March 20, 2025 20:00
PowerShell script to download DevOps Extensions from the marketplace as a local file
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[string] $Publisher,
[Parameter(Mandatory = $true)]
[string] $ExtensionName,
[Parameter(Mandatory = $true)]
@ryanspletzer
ryanspletzer / Install-PowerShellService.ps1
Created July 26, 2019 20:28 — forked from fireflycons/Install-PowerShellService.ps1
Script to install a PowerShell script as a Windows Service using NSSM
<#
.SYNOPSIS
Installs PowerShell scripts as Windows Services.
.DESCRIPTION
Installs or removes PowerShell script services.
When installing, any additional command line arguments besides the mandatory ones are supplied as arguments to the script you are installing, and credentials for the service will be prompted for.
The service will be installed for automatic start, however the initial state is 'Stopped'
This tool will additionally pass the switch -Service to the target script which it should implement to know it is running as a service.
@jonathanelbailey
jonathanelbailey / iso_image_edit.psm1
Last active August 14, 2025 19:21
a powershell module that allows for the modification of ISO images.
# this function grabs the iso image from the user supplied http location.
function get-isoimage{
[CmdletBinding()]
param(
$uri,
$workingfolder
)
begin{
$file_name = $uri -replace "http://[\s\S]+\/([\s\S]+\.iso)$",'$1'
$out_file = Join-Path $workingfolder -ChildPath $file_name
@elico
elico / vnc-id-proxy.go
Created December 8, 2016 15:28
A tightvnc "attach" proxy that adds the functionality to use ultravnc repeater and ultravnc viewer and connect to the client based on the ID.
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
"io"
"io/ioutil"
"net"
@RafPe
RafPe / New-nLogLogger.ps1
Last active March 28, 2025 19:40
Nlog logging with PowerShell
$dllBytes = [System.IO.File]::ReadAllBytes( "C:\NLog.dll")
[System.Reflection.Assembly]::Load($dllBytes)
# Create object that we will use to send customized info
# This is to be used if you use ${event-context:item=MyValue} in your config !
$cos = new-object NLog.LogEventInfo
$cos.Level = [NLog.LogLevel]::Info
$cos.Message = 'executing something really cool'
# Load XML configuration and use it
@magnetikonline
magnetikonline / README.md
Last active October 31, 2025 20:11
NSSM - the Non-Sucking Service Manager cheatsheet.