Skip to content

Instantly share code, notes, and snippets.

View rjt's full-sized avatar

Robert Townley rjt

View GitHub Profile
@rjt
rjt / Reset-WindowsUpdate.ps1
Last active August 24, 2023 18:51 — forked from desbest/Reset-WindowsUpdate.ps1
Reset Windows Update Client Settings Script
<#
.SYNOPSIS
Reset-WindowsUpdate.ps1 - Resets the Windows Update components
.DESCRIPTION
This script will reset all of the Windows Updates components to DEFAULT SETTINGS.
.OUTPUTS
Results are printed to the console. Future releases will support outputting to a log file.
@rjt
rjt / Get-ParameterValues.ps1
Created December 1, 2021 04:55 — forked from elovelan/Get-ParameterValues.ps1
Rather better than `$PSBoundParameters`
function Get-ParameterValues {
<#
.Synopsis
Get the actual values of parameters which have manually set (non-null) default values or values passed in the call
.Description
Unlike $PSBoundParameters, the hashtable returned from Get-ParameterValues includes non-empty default parameter values.
NOTE: Default values that are the same as the implied values are ignored (e.g.: empty strings, zero numbers, nulls).
.Link
https://gist.github.com/Jaykul/72f30dce2cca55e8cd73e97670db0b09/
.Link
@rjt
rjt / RecycleBin.ps1
Created October 23, 2017 02:21 — forked from lazywinadmin/RecycleBin.ps1
RecycleBin PowerShell script
<#
This script creates object which correctly works with ntfs streams and reparse points
Usage samples:
'.\*.bak' | recycle -WipeOut -> multiplies objects by zero
recycle -Path '.\*.ini' -> sends objects to Recycle Bin
$RecycleBin.Measure() -> returns true size of all items in Recycle Bin
$RecycleBin.Clear() -> this is obvious
$RecycleBin.List() -> returns friendly items list