Command | Shortcut Icon Type |
---|---|
Shutdown.exe /r /t 00 | Restart |
rundll32.exe powrprof.dll,SetSuspendState 0,1,0 | Sleep |
rundll32.exe PowrProf.dll,SetSuspendState | Hibernate |
Rundll32.exe User32.dll,LockWorkStation | Lock PC |
This file contains hidden or 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
Add-Type -AssemblyName System.Windows.Forms | |
Add-Type -AssemblyName System.Drawing | |
$formHome = New-Object system.Windows.Forms.Form | |
$formHome.ClientSize = '650,300' | |
$formHome.text = "STL Printers" | |
$formHome.TopMost = $false | |
$items = New-Object system.Windows.Forms.ListBox | |
$items.text = "listBox" |
This file contains hidden or 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
$1DrivePath = "C:\users\XXXXXXXXXX\OneDrive\windowsterminal\settings.json" | |
$params = @{ | |
Path = "$ENV:Userprofile\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" | |
ItemType = "HardLink" | |
Value = $1DrivePath | |
} | |
Move-Item -Path $params.path -Destination $params.value | |
New-Item @params |
This file contains hidden or 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
[CmdletBinding(SupportsShouldProcess)] | |
Param( | |
#how many backup copies should be saved | |
[int]$Limit = 7, | |
#backup folder | |
[parameter(HelpMessage = "Specify the backup location")] | |
[ValidateScript({Test-Path $_})] | |
[string]$Destination = "C:\users\jeff\OneDrive\windowsTerminal" | |
) |
This file contains hidden or 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 Get-FileDimensionAndPath | |
{ | |
Param([string]$folder) | |
$shell = New-Object -ComObject Shell.Application | |
$shellFolder = $shell.namespace($folder) | |
foreach ($file in $shellFolder.items()) | |
{ | |
$hash =@{ |
This file contains hidden or 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 Resize-Image | |
{ | |
<# | |
.SYNOPSIS | |
Resize-Image resizes an image file | |
.DESCRIPTION | |
This function uses the native .NET API to resize an image file, and optionally save it to a file or display it on the screen. You can specify a scale or a new resolution for the new image. | |
It supports the following image formats: BMP, GIF, JPEG, PNG, TIFF |
This file contains hidden or 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 | |
Removes ghost devices from your system | |
.DESCRIPTION | |
This script will remove ghost devices from your system. These are devices that are present but have an "InstallState" as false. These devices are typically shown as 'faded' | |
in Device Manager, when you select "Show hidden and devices" from the view menu. This script has been tested on Windows 2008 R2 SP2 with PowerShell 3.0, 5.1, Server 2012R2 | |
with Powershell 4.0 and Windows 10 Pro with Powershell 5.1. There is no warranty with this script. Please use cautiously as removing devices is a destructive process without | |
an undo. | |
.PARAMETER filterByFriendlyName | |
This parameter will exclude devices that match the partial name provided. This paramater needs to be specified in an array format for all the friendly names you want to be excluded. |
This file contains hidden or 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
Invoke-Command -ComputerName $WBComputers.Name -ScriptBlock { | |
$GoneUsers = Get-WmiObject -Class win32_userprofile | | |
Select-Object -Property *, @{ | |
NAME = 'user' | |
EXPRESSION = { | |
((New-Object -TypeName System.Security.Principal.SecurityIdentifier -ArgumentList ($_.SID)).Translate([System.Security.Principal.NTAccount])).Value | |
} | |
} | | |
Where-Object -FilterScript { | |
$_.User -eq $null |
This file contains hidden or 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 Convert-Image | |
{ | |
<# | |
.NOTES | |
Author: Randy Turner | |
Version: 1.0 - 06/16/2019 | |
.SYNOPSIS | |
Resize and optionally convert an image file. |
This file contains hidden or 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
#Source: https://www.reddit.com/r/PowerShell/comments/f91iv8/powershell_rdp_shortcut/fiovdac?utm_source=share&utm_medium=web2x | |
$wshshell = New-Object -ComObject WScript.Shell | |
$lnk = $wshshell.CreateShortcut("C:\Users\Public\Desktop\RDP.lnk") | |
$lnk.TargetPath = "%windir%\system32\mstsc.exe" | |
$lnk.Arguments = "/v:$IPofTarget" | |
$lnk.Description = "RDP" | |
$lnk.Save() |