Utilities
General-purpose helpers for everyday tasks. This page groups small utilities that don't need a dedicated section yet.
For full details and examples, run Get-Help Join-ClipboardLines -Detailed, Get-Help Update-CSVDelimiter -Detailed, or Get-Help Update-PS7 -Detailed.
Join-ClipboardLines
Join-ClipboardLines turns a list of lines from the clipboard into a single PowerShell-ready string.
Syntax
Join-ClipboardLines [-Separator <String>] [-Quote <String>] [-RemoveDuplicates] [-ShowOutput] [-NoClipboard]
| Parameter | Description | Required | Default |
|---|---|---|---|
Separator | String used between items. | No | , |
Quote | Quote character to wrap each item (empty string disables quoting). | No | " |
RemoveDuplicates | Remove duplicate lines before joining. | No | False |
ShowOutput | Write the joined string to the pipeline. | No | False |
NoClipboard | Do not copy the output back to the clipboard. | No | False |
Examples
# Join lines as a PowerShell-ready string and copy the result back to the clipboard (default)
Join-ClipboardLines
# No quotes, custom separator
Join-ClipboardLines -Separator '; ' -Quote ''
# Remove duplicates before joining
Join-ClipboardLines -RemoveDuplicates
# Show the joined string in the output
Join-ClipboardLines -ShowOutput
# Return output only (no clipboard write)
Join-ClipboardLines -NoClipboard
- Empty lines are ignored.
- When
-RemoveDuplicatesis used, the first occurrence is kept and order is preserved. - The command prints the number of joined items, and (if enabled) the number of duplicates removed.
- The joined string is only written to the pipeline when
-ShowOutputis used. - Copies output to the clipboard by default (unless
-NoClipboardis used). - Requires clipboard availability in the current session.
Update-CSVDelimiter
Update-CSVDelimiter switches CSV files between comma and semicolon separators while preserving encoding.
Syntax
Update-CSVDelimiter -FilePath <String> [-Encoding <String>] [-ToComma] [-ToSemicolon]
| Parameter | Description | Required | Default |
|---|---|---|---|
Encoding | Input/output encoding. | No | ISO-8859-15 |
FilePath | Path to the CSV file. | Yes | - |
ToComma | Convert ; to ,. | No | False |
ToSemicolon | Convert , to ;. | No | False |
Examples
# Convert semicolons to commas
Update-CSVDelimiter -FilePath 'C:\path\to\file.csv' -ToComma
# Convert commas to semicolons with a custom encoding
Update-CSVDelimiter -FilePath 'C:\path\to\file.csv' -Encoding 'UTF8' -ToSemicolon
- Default encoding is
ISO-8859-15. - The cmdlet overwrites the target file with the updated delimiter.
Update-PS7
Update-PS7 runs the official Microsoft helper script to install or upgrade PowerShell 7 via MSI. Since PowerShell 7.7 ships no MSI package, this means the latest 7.6 LTS release.
Syntax
Update-PS7 [-Force]
- Reads PowerShell's
tools/metadata.json, the same file the upstreaminstall-powershell.ps1script reads. With-UseMSIthe script installs the release inReleaseTag(the latest 7.6 LTS), soUpdate-PS7compares your version against that one. - Runs the installer with
-UseMSI. The upstream script no longer accepts a-Versionparameter, so version pinning isn't possible. - If the installed version already matches that release, it warns and skips the install; use
-Forceto reinstall anyway. - If a newer stable release exists without an MSI package (for example 7.7), it warns you: install it by hand if you need it.
- If the metadata can't be read, it falls back to running the installer directly.
- Ideal for keeping servers and managed endpoints on the latest PowerShell 7.6 LTS, installed machine-wide.
- The installer UI appears; run from an elevated session for system-wide upgrades.
- On Windows PowerShell 5.1, the function enforces TLS 1.2 before downloading.
Questions and answers
Does Update-PS7 install silently?
No. It downloads and runs the official Microsoft script with the interactive MSI (-UseMSI). Use an elevated session for system-wide upgrades.
What if I'm already on the latest version?
Update-PS7 compares your running version against the latest MSI release (7.6 LTS) and skips the install with a warning. Pass -Force to reinstall regardless.
Why doesn't Update-PS7 install PowerShell 7.7?
Microsoft no longer publishes MSI packages from PowerShell 7.7 on, only ZIP and MSIX. Update-PS7 stays on 7.6 LTS, which is supported until November 14, 2028. The reasons are in this post.