Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vborovikov/pwsh
PowerShell profile and scripts
https://github.com/vborovikov/pwsh
powershell powershell-profile powershell-profile-script powershell-script
Last synced: 17 days ago
JSON representation
PowerShell profile and scripts
- Host: GitHub
- URL: https://github.com/vborovikov/pwsh
- Owner: vborovikov
- Created: 2023-04-20T07:44:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-04T09:37:49.000Z (25 days ago)
- Last Synced: 2025-01-04T11:00:08.611Z (25 days ago)
- Topics: powershell, powershell-profile, powershell-profile-script, powershell-script
- Language: PowerShell
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PowerShell profile and scripts
Defines a custom prompt function that replaces the `$Home` part of the current path with '~', displays the time, current path, git status, and .NET version in the current project file, and sets the window title to the current folder name. The prompt also displays a different prompt character ('>' or '>>') depending on the current nested prompt level and whether there was an error in the previous command.
How it might look like:
![Windows Terminal](misc/terminal.png)
![Visual Studio Code](misc/vscode.png)
## Installation
The script works for PowerShell v5.1 and higher.
```bash
PS > copy .\profile.ps1 $Profile.CurrentUserAllHosts
```## MyTools.psm1
The `Find-File` function takes a `FileName` parameter and searches the current directory and all subdirectories for files with that name. It returns an array of `System.IO.FileInfo` objects representing the matching files.
The `Open-File` function is used to open files in an external editor. It has two ways to input a file: by pipeline or by filename. If a `FileInfo` object is piped in, it will be opened in the default editor. If a filename is provided, it will be opened in the specified editor (`C:\Program Files\EditPlus\editplus.exe` by default). It accepts an optional `$Index` parameter that can be used to open multiple files by index.