Skip to content

Instantly share code, notes, and snippets.

Measure-Command {
$sessionstate = [system.management.automation.runspaces.initialsessionstate]::CreateDefault()
$runspacepool = [runspacefactory]::CreateRunspacePool(1, 10, $sessionstate, $Host)
$runspacepool.Open()
$ScriptBlock = {
Param ($File)
$tempHash = @{}
ForEach ($Item in $File) {
$RawFile = [activator]::CreateInstance([System.IO.StreamReader],@($Item, [System.Text.Encoding]::UTF8,$True,524288)).ReadToEnd()
@lalibi
lalibi / Set-WindowState.ps1
Last active April 11, 2025 09:14 — forked from Nora-Ballard/Set-WindowState.ps1
Hide, Show, Minimize, Maximize, etc window from Powershell.
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`.
@NickCraver
NickCraver / Windows10-Setup.ps1
Last active February 6, 2025 04:09
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@rufflabs
rufflabs / LSARecovery
Created May 23, 2015 14:26
Retrieve saved passwords from local service accounts
function Enable-TSDuplicateToken {
<#
.SYNOPSIS
Duplicates the Access token of lsass and sets it in the current process thread.
.DESCRIPTION
The Enable-TSDuplicateToken CmdLet duplicates the Access token of lsass and sets it in the current process thread.
The CmdLet must be run with elevated permissions.
.EXAMPLE
@guitarrapc
guitarrapc / WindowsCredentialVault.psm1
Last active January 15, 2021 18:49
PowerShell Windows Credential Vault Module
function InitializeWindowsCredential
{
Write-Verbose ("Loading PasswordVault Class.")
[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
}
InitializeWindowsCredential
function ConvertTo-PasswordCredential
{
<#
.SYNOPSIS
Resize an image
.DESCRIPTION
Resize an image based on a new given height or width or a single dimension and a maintain ratio flag.
The execution of this CmdLet creates a new file named "OriginalName_resized" and maintains the original
file extension
.PARAMETER Width
The new width of the image. Can be given alone with the MaintainRatio flag
.PARAMETER Height
@rxaviers
rxaviers / gist:7360908
Last active May 18, 2025 08:49
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue: