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
## Get-LinkTarget.ps1 | |
# Note: Script should be symlinked as follows: | |
# Get-LinkTarget.ps1 -> Resolve-UNCPath.ps1 | |
# Get-LinkTarget.ps1 -> Resolve-JunctionPath.ps1 | |
# Get-LinkTarget.ps1 -> Resolve-HardlinkPath.ps1 | |
# Get-LinkTarget.ps1 -> Resolve-SymlinkPath.ps1 | |
# Get-LinkTarget.ps1 -> Resolve-ReparsePointPath.ps1 | |
function Global:Get_UNCPath($l_dir) | |
{ |
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 | |
Copies Windows Spotlight images from ContentDeliverManager cache folder to "Pictures" folder. | |
.DESCRIPTION | |
Copies all images larger than 50KB from Windows Spotlight cache folder to \Pictures\Backgrounds\Spotlight, | |
creating destination directory if it does not exist. | |
.NOTES | |
Requires Lock Screen Background set to "Windows Spotlight" (Start-Process ms-settings:lockscreen). | |
Spotlight cache folder will populate over time, with new images usually added several times per week. | |
Caveat: Windows Store also stores images in the same dir, some may be mistaken as a spotlight images. |
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
############################################################################################################################################ | |
## Prompt ## | |
############################################################################################################################################ | |
Clear-Host | |
[ScriptBlock]$Prompt = { | |
$origLastExitCode = $global:LASTEXITCODE | |
Set-StrictMode -Version 'Latest' | |
$gitLoaded = $false # skip stupid git module, adds ~1000ms to startup time. |
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
<#PSScriptInfo | |
.NAME Get-FileFromUri.ps1 | |
.VERSION 1.0 | |
.GUID 5c779f0b-6db9-43bd-a0c0-246125f9c7e9 | |
.TAGS Get-FileFromUri PSWget wget WebRequest WebClient Invoke-WebRequest | |
#> | |
<# | |
.SYNOPSIS | |
Retrieves remote content to the current directory or OutFile path. |
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 which2 { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
$Name | |
) | |
$ErrorActionPreference = 'Stop' | |
try { | |
[object]$getCommand = Get-Command $Name |
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
<# | |
Invoke-WmiMonitorBrightness.ps1 - Backlight control for screen brightness (Note: Does not work with ALS enabled) | |
#> | |
function Invoke-WmiMonitorBrightness() { | |
Set-StrictMode -Version Latest | |
[scriptblock] $GetMonitorBrightness = { | |
(Get-Ciminstance -Namespace ROOT/wmi -ClassName WmiMonitorBrightness).CurrentBrightness | |
} |
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
# /etc/sysctl.d/50-coredump.conf | |
################################################################################## | |
## NO DUMPING ALLOWED ## | |
## VIOLATORS WILL BE PROSECUTED ## | |
################################################################################## | |
fs.suid_dumpable = 0 | |
kernel.suid_dumpable = 0 | |
kernel.core_pattern = |/bin/false |
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
<# | |
volume.ps1 - Get/Set IAudioEndpointVolume | |
Note: Get-Volume/Set-Volume conflicts with Storage\MSFT_Volume | |
#> | |
function GetSet-Volume { | |
Param( | |
[Parameter(mandatory=$false)] [float] [ValidateRange(0.000,1.000)] $Value, | |
[Alias("M*","U*")] [switch] $Mute | |
) |
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
## File: Get-FileAttributesEx.ps1 | |
<# | |
.SYNOPSIS | |
Lists NTFS file or folder attributes and flags. | |
.DESCRIPTION | |
Lists many undocumented or otherwise inaccessible file attributes and flags. | |
.PARAMETER Path | |
Path to file(s)/folder(s) to list properties. Wildcards and hidden or system files are supported. | |
.INPUTS System.Management.Automation.PathInfo, System.String | |
You can pipe PathInfo objects or strings that contain paths to this cmdlet. |
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
<# | |
Get-Clipboard.ps1 - Gets clipboard content if content type is text. | |
Note: Conflicts/replaces Pscx\Get-Clipboard which doesn't work in powershell >= 6 | |
#> | |
function Get-ClipboardText([switch][Alias("S*","L*")]$SplitLF) { | |
Set-StrictMode -Version 'Latest' | |
if($SplitLF) { | |
# Note: Newline CRLF/CR/LF handling should be automatic, but just in case... | |
$cmd = { | |
Add-Type -Assembly PresentationCore |