Skip to content

Instantly share code, notes, and snippets.

@SteveL-MSFT
SteveL-MSFT / profile.ps1
Last active July 2, 2025 17:52
PowerShell Prompt
#Requires -Version 7
# Version 1.2.13
# check if newer version
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e"
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version')
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)"
if ([System.IO.File]::Exists($latestVersionFile)) {
@a5ync
a5ync / InstallNodeAppAsWindowsService.ps1
Created April 20, 2016 01:04
Powershell wrapper over NSSM (Non-Sucking Service Manager), to install Node app as a Windows-Service
#please read the NSSM https://nssm.cc/usage
Function Install-Service {
param(
[Parameter(Mandatory=$true)][string]$NSSMPath,
[Parameter(Mandatory=$true)][string]$serviceName ,
[Parameter(Mandatory=$true)][string]$serviceExecutable ,
[Parameter(Mandatory=$false)][string]$serviceExecutableArgs ,
[Parameter(Mandatory=$false)][string]$serviceAppDirectory ,
[Parameter(Mandatory=$true)][string]$serviceErrorLogFile ,
[Parameter(Mandatory=$true)][string]$serviceOutputLogFile ,
@proxb
proxb / Example1Runspace.ps1
Created August 10, 2015 00:50
Example 1 of returning data back from a runspace
# Create an array of computers to do work against
$Computers = “computer01”,”computer02”,”computer03”,”computer04”,”computer05”
# Create an empty array that we'll use later
$RunspaceCollection = @()
# This is the array we want to ultimately add our information to
[Collections.Arraylist]$qwinstaResults = @()
# Create a Runspace Pool with a minimum and maximum number of run spaces. (http://msdn.microsoft.com/en-us/library/windows/desktop/dd324626(v=vs.85).aspx)