This repository contains a collection of useful PowerShell functions and aliases for developers. The goal is to provide a starting point for developers to customize their PowerShell profiles and share their own contributions.
-
cpwd— Copies current path to clipboard
→Copy-PathToClipboard -
pas— Starts Laravel development server
→Start-LaravelServer -
pa— Runsphp artisanin Laravel project
→Invoke-Artisan -
gpush— Push git changes with a commit message
→Push-GitChanges -
touch— Creates a file (defaults totmp.txtif no name provided)
→New-File -
phpserve— Starts PHP built-in web server
→Start-phpserve -
pyserve— Starts Python HTTP server
→Start-PythonServer -
gt— Navigate to a folder using a partial name
→Find-AndOpenFolder -
Scane-Folders— Scan and cache folder paths from home directory
→Index-Folders -
ex— Open current directory in File Explorer
→Open-InExplorer -
b— Go back to the previous directory
→Go-PreviousDirectory -
mkg— Create a directory and enter it
→New-AndEnterFolder -
head— Show first few lines of a file
→Get-FileHead -
tail— Show last few lines of a file
→Get-FileTail -
dl— Download a file using BITS with resume support
→Start-FileDownload
To start using the PowerShell Developer Profile, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/tauseedzaman/PS1-Dev-Profile
-
Import the profile in your PowerShell environment. Open PowerShell and run:
notepad $PROFILEAdd the following line to your profile file:
. <path-to-repo>\ps1-dev-profile.ps1
Replace
<path-to-repo> with the path to the cloned repository. -
Save and close the profile file. Then restart PowerShell, and you're ready to go!
cpwdCopies the current working directory path to the clipboard, making it easy to share or use in other commands.
pasStarts the Laravel development server, allowing you to quickly test and preview your application.
paRuns the PHP Artisan command-line tool for Laravel, providing a convenient way to manage and interact with your Laravel project.
gpush <message>Pushes local Git changes to the remote repository with a custom commit message, streamlining the Git workflow.
touch <filename>create file if not argument is provided then tmp.txt is created.
phpserve <port>Start PHP built-in web server in the current folder, if port is not provided then default port is 8080
pyserve <port>Start Python built-in Http server in the current folder, if port is not provided then default port is 8080
gt <some-folder>The gt function searches for a folder whose name matches the specified partial name. If multiple matches are found, it prompts you to select one. Once a unique match is determined, it navigates directly to that folder.
Before Using gt:
Before using the gt function, it's recommended to run the Scane-Folders function. This function scans your user home directory and stores the paths of all subfolders in a file called folderPaths.txt. This file is used by the gt function to quickly locate folders based on partial names.
To update folder paths, run:
Scane-FoldersExample:
Suppose you want to navigate to a folder named "Documents" within your user directory, but you're not sure of the full path. You can simply use gt followed by the partial name:
gt DocumentsIf multiple folders with "Documents" in their names exist, gt will display them and prompt you to select the desired one. After selecting, you will be navigated to the chosen folder
exOpens the current working directory in File Explorer
bGo back to the previous directory
mkg <directory-name>Create a directory with provided name and navigates into it
head <file-path> <lines-count>Display the first few lines of a file, the number of line showed by default is 10.
tail <file-path> <lines-count>Display the last few lines of a file, the number of line showed by default is 10.
df <file-url>- Fork the repository and create a new branch for your feature or fix.
- Write a clear and concise commit message describing your changes.
- Open a pull request to merge your changes into the main branch.
This repository is licensed under the MIT License.