This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Log-Start{ | |
<# | |
.SYNOPSIS | |
Creates log file | |
.DESCRIPTION | |
Creates log file with path and name that is passed. Checks if log file exists, and if it does deletes it and creates a new one. | |
Once created, writes initial logging data | |
.PARAMETER LogPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Written by Mike Bantegui (Last Updated 2015-03-05) | |
# Use at your own caution! I take no responsibility for any damage you may cause on your system. | |
# Known to support: Windows Server 2012 R2 | |
function Request-ElevatedPrompt | |
{ | |
# Adapted from Benjamin Armstrong's "A self elevating PowerShell script" | |
# http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/09/23/a-self-elevating-powershell-script.aspx | |
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$principal = New-Object System.Security.Principal.WindowsPrincipal($identity) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Creates an custom ErrorRecord that can be used to report a terminating or non-terminating error. | |
.Description | |
Creates an custom ErrorRecord that can be used to report a terminating or non-terminating error. | |
.Parameter Exception | |
The Exception that will be associated with the ErrorRecord. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Condition statement": { | |
"prefix": "cond", | |
"body": [ | |
"$1 { $0; break }" | |
], | |
"description": "Switch condition statement" | |
}, | |
"Condition single quoted string statement": { | |
"prefix": "condsqstr", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) | |
@rem *** Disable Some Service *** | |
sc stop DiagTrack | |
sc stop diagnosticshub.standardcollector.service | |
sc stop dmwappushservice | |
sc stop WMPNetworkSvc | |
sc stop WSearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Sender = "Trevor Jones" | |
$Message = "Hey buddy - ready for lunch?" | |
$RemoteComputer = "PC001" | |
Function New-ToastNotification { | |
Param($Sender,$Message) | |
# Required parameters | |
$AudioSource = "ms-winsoundevent:Notification.Default" | |
$HeaderFormat = "ImageAndTitle" # Choose from "TitleOnly", "ImageOnly" or "ImageAndTitle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Save-KBFile { | |
<# | |
.SYNOPSIS | |
Downloads patches from Microsoft | |
.DESCRIPTION | |
Downloads patches from Microsoft | |
.PARAMETER Name | |
The KB name or number. For example, KB4057119 or 4057119. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was initially generated by Windows Terminal 0.11.1121.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
OlderNewer