PoshFunctions

2.2.12

A curated collection of over 250 PowerShell functions. Many functions written by me. Others are attributed wherever possible.

Minimum PowerShell version

5.0

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name PoshFunctions

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name PoshFunctions

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2025 Bill Riedy. All rights reserved.

Package Details

Author(s)

  • Bill Riedy

Tags

base64 beep binaryip calendar capslock color-hex color-rgb color-show computersite computer-site credential date-random datetime date-truncate days-week decimalip display dns-async dotteddecimalip email-address expand-string expand-tab exponentiation file file-encoding file-invalidchar folder format functions gui ini inputbox ip iprange isadmin isdate ishexstring isnumeric isvalidemail isvalidip library macaddress magic8ball markdown msgbox numlock ping-async popup progress random-date registry reverse-string rot13 round savefile scrolllock set-type share-permission share-stat shortcut sid speak subnetmask system timezone urlencode utc wrap-text xml

Functions

Add-FileAttribute Compare-ObjectProperty Compare-ObjectSetComplement Compare-ObjectSetDifference Compare-ObjectSetIntersection Compare-ObjectSetUnion Compare-PSGalleryObject Convert-HexToRGB Convert-Int32ToUint32 Convert-Int64ToText Convert-Int64ToUint64 Convert-ObjectToHashtable Convert-RGBToHex Convert-SecureStringToString Convert-UserFlag ConvertFrom-Base64 ConvertFrom-Binary ConvertFrom-DateTime ConvertFrom-FsRight ConvertFrom-Hex ConvertFrom-HexString ConvertFrom-HtmlEncode ConvertFrom-RomanNumeral ConvertFrom-UrlEncode ConvertFrom-UTC ConvertFrom-Xml ConvertTo-Base64 ConvertTo-Binary ConvertTo-BinaryIPv4 ConvertTo-Bool ConvertTo-DateTime ConvertTo-DecimalIPv4 ConvertTo-DottedDecimalIPv4 ConvertTo-Hex ConvertTo-HexString ConvertTo-HtmlEncode ConvertTo-OrderedDictionary ConvertTo-PFEscape ConvertTo-RomanNumeral ConvertTo-UncPath ConvertTo-UrlEncode ConvertTo-UTC Copy-Object Expand-IPv6 Expand-String Expand-Tab Export-CSVSortedColumn Export-FontSample FileSizeAbove FileSizeBelow Format-MacAddress Format-RandomCase Format-ReverseString Format-ReverseToken Format-SortedList Format-TitleCase Format-WrapText Get-AppEventSound Get-ArpTable Get-Assoc Get-AutoRun.inf Get-BashPath Get-BinaryType Get-CeasarCipher Get-ComputerSite Get-ComputerUptime Get-ConsoleColor Get-ConsoleWindowSize Get-DaysOfWeek Get-Desktop.ini Get-DiceRoll Get-DiskType Get-DisplayBrightness Get-DNSHostEntryAsync Get-DriveStat Get-DuplicateFileName Get-Enum Get-ErrorInfo Get-ExecutableForFile Get-Factorial Get-FileEncoding Get-FileName Get-FileSizeOnDisk Get-FileWithLeadingSpace Get-FolderName Get-Font Get-Fortune Get-FsRight Get-Ftype Get-InvalidFileCharacter Get-IpRange Get-IpV4Network Get-LastDayInMonth Get-List Get-LocalProfile Get-LongName Get-MachineType Get-MacVendor Get-Magic8Ball Get-Months Get-MyLocalLogonTime Get-NamedColor Get-NetworkCredential Get-NTFSPermission Get-NtpDate Get-Power Get-PrintableAscii Get-PrivateProfileComment Get-PrivateProfileSection Get-PrivateProfileSectionNames Get-PrivateProfileString Get-ProcessUser Get-PSWho Get-RandomDate Get-RandomHexDigit Get-RandomMacAddress Get-RebootHistory Get-RegExpandString Get-RegistryValue Get-RelativePath Get-Round Get-SaveFileName Get-ScheduledTaskUser Get-ServiceUser Get-Shortcut Get-ShortName Get-SID Get-SpeakerVolume Get-SpecialFolder Get-SqlDatabase Get-SqlIndexFragmentation Get-SqlStoredProcedure Get-StaticProperty Get-String Get-StringHash Get-SubnetMaskIPv4 Get-TruncatedDate Get-Type Get-TypeAccelerator Get-UrlContent Get-VssVolume Get-VssWriter Get-VssWriterToService Get-WordCount Get-WordList grep Invoke-Beep Invoke-CountdownTimer Invoke-SoundPlayer Invoke-Speak Join-Object Lock-Workstation Measure-Char Merge-Object mklink Move-ToRecycleBin New-ColorPicker New-Credential New-DatePicker New-FontPicker New-InputBox New-InputBoxSecureString New-LocalAdmin New-MailToURI New-MessageBox New-PFDateFormat New-QR New-QRCode New-RandomPassword New-Screenshot New-Shortcut New-SmsUri New-TelephoneUri New-TemporaryFileWithExtension New-VirtualHardDisk New-WifiUri Optimize-SqlIndexFragmentation Optimize-SqlStoredProcedure Out-PDFToPrinter Read-HostPause Read-HostWithDefault Remove-BlankOrComment Remove-EmptyProperty Remove-FileAttribute Remove-OldFiles Remove-QuotesFromCsv Remove-TeamsCache Remove-TemporaryFile Remove-Trailing Reset-Desktop Resolve-FQDN Resolve-HostName Resolve-PathForce sed Set-AutoRun.inf Set-Capslock Set-Desktop.ini Set-Display Set-EOLTerminator Set-FileEncoding Set-FileTime Set-Numlock Set-PrivateProfileComment Set-PrivateProfileString Set-Scrolllock Set-SpeakerMute Set-SpeakerVolume Set-Type Set-WindowState Set-WindowStyle Show-Calendar Show-FileAttribute Show-Object Show-Progress Split-CanonicalName Split-DistinguishedName Split-Line Start-ADReplication Start-RecordSession Stop-RecordSession Switch-Mute Test-ConnectionAsync Test-CSVFormat Test-IsAdmin Test-IsCapsLock Test-IsDate Test-IsFileLocked Test-IsHexString Test-IsLocalIPv4 Test-IsNull Test-IsNumeric Test-IsNumLock Test-IsScrollLock Test-IsSpeakerMute Test-IsValidEmailAddress Test-IsValidIPv4 Test-IsValidIPv6 Test-MultipleBool Test-Network Test-NtpDateVsNow Test-Password Test-PasswordComplexity Test-Port Test-Set Update-ExplorerIcon Use-Stopwatch Write-AnsiString Write-SelectStatement Write-StringArray Write-StringHash Write-TextMenu

Dependencies

This module has no dependencies.

Release Notes

For full release notes see .\Resources\ReleaseNotes.txt
### 2.2.12
* added about_PoshFunctions for an overview of the module
* updated PoshFunctions.psm1 - added $Script:IconFile variable
* updated Wisdom.txt - minor grammatical mistakes
* added ConvertTo-PFEscape - some of the New-*Uri functions needed to be able to escape strings in a special way
* added Get-LocalProfile - to return information on profiles local to the machine
* added Get-SpeakerVolume - wanted to be able to determine what the current volume of the speakers are
* added Get-VssWriterToService - VSS writers are managed by a particular service and this corresponds the two
* added New-LocalAdmin - to quickly create local admin user account
* added New-MailToURI - used to create properly formatted string to generate a QR code to begin composing an email
* added New-QRCode - to create a QR code from a string of text. Useful with New-*URI functions
* added New-SmsUri - used to create properly formatted string to generate a QR code to compose a text message
* added New-TelephoneUri - used to create properly formatted string to generate a QR code to begin calling a number
* added New-TemporaryFileWithExtension - extend functionality of New-TemporaryFile so that a custom extension can be used
* added New-WifiUri - used to create properly formatted string to generate a QR code to join a particular SSID
* added Remove-OldFiles - given a path, a filespec, and a count it will search that path for the filespec and keep the latest count of files that match
* added Remove-TemporaryFile - to delete temp files older than X days. Can specify -All to run against all user profiles (need to run as Admin)
* added Set-FileTime - to be able to set CreationTime, LastAccessTime, LastWriteTime
* added Set-SpeakerMute - using API based function
* added Test-IsSpeakerMute - using API based function
* added Write-AnsiString - to mimic the functionality of Write-Host, helpful when trying to create a single string to appear in Transcript file, otherwise writes multiple line entries
* deleted Show-ConsoleColor - incorporated into Get-ConsoleColor
* deleted Show-ConsoleColorWithBackground - incorporated into Get-ConsoleColor
* deleted Show-ShortDaysOfWeek - incorporated into Get-DaysOfWeek with -Short parameter
* deleted Show-ShortMonth - incorporated into Get-Months with -Short parameter
* deleted Show-SubnetMaskIPv4 - incorporated into Get-SubnetMaskIPv4 with -All parameter
* deleted Show-Timezone - no longer needed with Get-TimeZone from Microsoft.PowerShell.Management
* renamed Get-DaysOfWeek - from Show-DaysOfWeek, also incorporated -Short parameter so that this incorporates both functions
* renamed Get-Months - from Show-Month, also incorporated -Short parameter so that this incorporates both functions
* renamed Get-VssVolume - Original name 'Get-VssadminListVolumes', aliased to 'Get-VssadminListVolumes'
* renamed Get-VssWriter - Original name 'Get-VssadminListWriters', aliased to 'Get-VssadminListWriters'
* renamed Show-ColorWithBackground - from original name Show-ColorsWithBackground, aliased to Show-ColorsWithBackground. Be more Powershell-y
* renamed Show-ConsoleColor - from original name Show-AllColor, aliased to Show-AllColor
* rewrote New-QRCode - previous version relied on Google service no longer available, using a new service now, parameters changed
* rewrote Set-SpeakerVolume - to use API based function and not SendKeys
* updated Get-ComputerUptime - added credential to New-CimSession
* updated Get-ConsoleColor - incorporated -Show and -ShowWithBackground parameters
* updated Get-DisplayBrightness - using more standard -IncludeInput parameter
* updated Get-Enum - changed logic from adding to array with += to using [System.Collections.ArrayList] and .Add method
* updated Get-Font - updated comment help to indicate that it captures the state of fonts when the Powershell session initiated
* updated Get-Fortune - updated comment help and clarified a few things
* updated Get-IpRange - changed logic from adding to array with += to using [System.Collections.ArrayList] and .Add method
* updated Get-SubnetMaskIPv4 - added -All parameter, used parameter set names, defined default parameter set name, made subnet mask first property in output
* updated Get-Type - changed logic from adding to array with += to using [System.Collections.ArrayList] and .Add method
* updated Get-TypeAccelerator - changed logic from adding to array with += to using [System.Collections.ArrayList] and .Add method
* updated New-ColorPicker - changed how the icon is set
* updated New-DatePicker - changed how the icon is set
* updated New-FontPicker - changed how the icon is set
* updated New-InputBoxSecureString - added switch parameter to allow for string output as opposed to secure string output, changed how icon set
* updated New-MessageBox - corrected validation set for -Defaultbutton parameter
* updated New-RandomPassword - added -Clipboard switch, changed default for -NonAlphaChars, slight corrections to comment based help
* updated New-ScreenShot - added note in comment help that it may trigger anti-malware software
* updated New-VirtualHardDisk - updated comment help, removed unused variables
* updated Set-SpeakerVolume - use defined class to directly set the volume
* updated Start-ADReplication - made $Name optional and defaults to $env:COMPUTERNAME
* updated Test-IsScrollLock - updated comment help
* updated Test-Network - altered logic so that it returns an array even if returning 0 or 1 item

FileList

Version History

Version Downloads Last updated
2.2.12 (current version) 10 8/25/2025
2.2.11 63,477 7/5/2024
2.2.10 16,270 10/30/2023
2.2.9 7,328 9/30/2022
2.2.8 1,372 2/25/2022
2.2.7 237 11/17/2021
2.2.6 218 8/2/2021
2.2.5 13 8/2/2021
2.2.4 54 6/30/2021
2.2.3 36 6/3/2021
2.2.1.6 269 3/23/2021
2.2.1.5 70 2/15/2021
2.2.1.4 31 2/8/2021
2.2.1.3 64 12/17/2020
2.2.1.2 93 10/27/2020
2.2.1.1 41 10/12/2020
1.0.0.1 14 10/12/2020
Show more