Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
/ PowerShell Public archive

Collection of useful PowerShell functions, scripts, snippets and templates

License

Notifications You must be signed in to change notification settings

BornToBeRoot/PowerShell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PowerShell

My collection of useful functions, scripts, snippets and templates written by myself.

Description

Automate all the Things!

Module

How to install the module?

  1. Download the latest Release
  2. Copy the folder Module\LazyAdmin to C:\Users\%username%\Documents\WindowsPowerShell\Modules\
  3. Open up a PowerShell as an admin and set the execution policy: Set-ExecutionPolicy RemoteSigned
  4. Import the Module with the command Import-Module LazyAdmin (Maybe add this command to your PowerShell profile)

Available functions:

Function Category Description Help
ConvertFrom-Base64 Converter Convert a Base64 encoded string to a plain text string 📖
ConvertTo-Base64 Converter Convert a text (command) to an Base64 encoded string 📖
Convert-IPv4Address Converter Convert an IPv4-Address to Int64 and vise versa 📖
Convert-Subnetmask Converter Convert a subnetmask to CIDR and vise versa 📖
Find-StringInFile File Find a string in one or multiple files 📖
Test-IsFileBinary File Test if a file is binary 📖
Update-StringInFile File Replace a string in one or multiple files 📖
Get-InstalledSoftware Software Get all installed software with DisplayName, Publisher and UninstallString 📖
Clear-ARPCache Network Clear the ARP cache 📖
Get-ARPCache Network Get the ARP cache 📖
Get-MACAddress Network Get the MAC-Address from a remote computer 📖
Get-MACVendor Network Get Vendor from a MAC-Address 📖
Invoke-IPv4NetworkScan Network Powerful asynchronus IPv4 Network Scanner to scan an IP-Range or subnet 📖
Invoke-IPv4PortScan Network Powerful asynchronus IPv4 Port Scanner to scan a TCP Port-Range 📖
Send-WakeOnLan Network Send a network message to turn on or wake up a remote computer 📖
Get-ConsoleColor Other Get all available console colors 📖
Get-RandomPassword Security Generate passwords with a freely definable number of characters 📖
Get-RandomPIN Security Generate PINs with freely definable number of numbers 📖
Get-IPv4Subnet SubnetCalculator Calculate a subnet based on an IP-Address and the subnetmask or CIDR 📖
Split-IPv4Subnet SubnetCalculator Split a subnet in multiple subnets with given subnetmasks 📖
Add-TrustedHost TrustedHost Add a trusted host (WinRM) 📖
Get-TrustedHost TrustedHost Get trusted hosts (WinRM) 📖
Remove-TrustedHost TrustedHost Remove a trusted host (WinRM) 📖
Set-TrustedHost TrustedHost Set a trusted host (WinRM) 📖
Get-LastBootTime Windows Get the time when a computer is booted 📖
Get-WindowsProductKey Windows Get the Windows product key and some usefull informations about the system 📖
Get-WLANProfile WLAN Get WLAN profiles, include password as SecureString or as plain text 📖

Scripts

| Script | Description | Help | | :--- | :--- | :--- | :---: | | Convert-ROT13 | Rotate lower and upper chars by n places (Caesar cipher) | 📖 | | Convert-ROT47 | Rotate ascii chars by n places (Caesar cipher) | 📖 | | OptimizePowerShellStartup.ps1 | Optimize PowerShell startup by reduce JIT compile time with ngen.exe | 📖 |

Snippets

Snippet Description
ConnectToExchange2010.ps1 Connect to Exchange 2010 Management Shell in script
CredentialParameter.ps1 Parameter to pass credentials into a function/script
DefaultDisplayPropertySet.ps1 Set the default properties of an object
New-Object.ps1 Create a new PSObject with custom properties
PressAnyKeyToContinue.ps1 Wait until the user pressed a key
PromptForChoice.ps1 Prompt for choice
PSCustomObject.ps1 Create a new PSObject with custom properties (faster than New-Object/Add-Member)
RewriteInLine.ps1 Rewrite in Line (Write-Host "xx% complete")
SelfElevatingScript.ps1 Self elevate a PowerShell script/console with parameters
Send-MailMessage.ps1 Send a mail message via PowerShell

Regex

Regex Description
IPv4Address.ps1 Validate an IPv4-Address like 192.168.1.0
MACAddress.ps1 Validate a MAC-Address like 00:00:00:00:00:00 or 00-00-00-00-00-00 or 000000000000
Subnetmask.ps1 Validate an Subnetmask like 255.255.255.0

Templates

Template Description
Default.ps1 Default template for new scripts
Default.README.md Default template for documentation on GitHub
RunspacePool.ps1 RunspacePool template - run code asynchron (faster than PSJobs)

About

Collection of useful PowerShell functions, scripts, snippets and templates

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •