I am glad that this topic exists, very cool!
I download several functions, since I am the author of the module, I usually load the console and desperately need to know what's there.
write-host "Your modules are..." -ForegroundColor Red Get-module -li
Strength reinforcement
function prompt { $host.UI.RawUI.WindowTitle = "ShellPower"
mandatory everything that I can use, I will perform the functions here ...
# explorer command function Explore { param ( [Parameter( Position = 0, ValueFromPipeline=$true, Mandatory=$true, HelpMessage="This is the path to explore..." )] [ValidateNotNullOrEmpty()] [string]
I am an ALL administrator, so I need ...
Function RDP { param ( [Parameter( Position = 0, ValueFromPipeline=$true, Mandatory=$true, HelpMessage="Server Friendly name" )] [ValidateNotNullOrEmpty()] [string] $server ) cmdkey /generic:TERMSRV/$server /user:$UserName /pass:($Password.GetNetworkCredential().Password) mstsc /v:$Server /f /admin Wait-Event -Timeout 5 cmdkey /Delete:TERMSRV/$server }
Sometimes I want to run explorer as someone other than a registered user ...
#restarts explorer as the user in $UserName function New-Explorer {
Itβs just because itβs funny.
Function Lock-RemoteWorkstation { param( $Computername, $Credential ) if(!(get-module taskscheduler)){Import-Module TaskScheduler} New-task -ComputerName $Computername -credential:$Credential | Add-TaskTrigger -In (New-TimeSpan -Seconds 30) | Add-TaskAction -Script ` { $signature = @" [DllImport("user32.dll", SetLastError = true)] public static extern bool LockWorkStation(); "@ $LockWorkStation = Add-Type -memberDefinition $signature -name "Win32LockWorkStation" -namespace Win32Functions -passthru $LockWorkStation::LockWorkStation() | Out-Null } | Register-ScheduledTask TestTask -ComputerName $Computername -credential:$Credential }
I also have one for me, since WIN + L is too far away.
Function llm #lock Local machine { $signature = @" [DllImport("user32.dll", SetLastError = true)] public static extern bool LockWorkStation(); "@ $LockWorkStation = Add-Type -memberDefinition $signature -name "Win32LockWorkStation" -namespace Win32Functions -passthru $LockWorkStation::LockWorkStation()|Out-Null }
A few filters? I think so...
filter FileSizeBelow($size){if($_.length -le $size){ $_ }} filter FileSizeAbove($size){if($_.Length -ge $size){$_}}
I also have a few messages that I cannot do because they are not finished, but they are basically a way to save credentials between sessions without writing them as an encrypted file.