Skip to content

tauseedzaman/PS1-Dev-Profile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

PowerShell Profile For Developers

Overview

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.

📘 Alias Index

  1. cpwd — Copies current path to clipboard
    Copy-PathToClipboard

  2. pas — Starts Laravel development server
    Start-LaravelServer

  3. pa — Runs php artisan in Laravel project
    Invoke-Artisan

  4. gpush — Push git changes with a commit message
    Push-GitChanges

  5. touch — Creates a file (defaults to tmp.txt if no name provided)
    New-File

  6. phpserve — Starts PHP built-in web server
    Start-phpserve

  7. pyserve — Starts Python HTTP server
    Start-PythonServer

  8. gt — Navigate to a folder using a partial name
    Find-AndOpenFolder

  9. Scane-Folders — Scan and cache folder paths from home directory
    Index-Folders

  10. ex — Open current directory in File Explorer
    Open-InExplorer

  11. b — Go back to the previous directory
    Go-PreviousDirectory

  12. mkg — Create a directory and enter it
    New-AndEnterFolder

  13. head — Show first few lines of a file
    Get-FileHead

  14. tail — Show last few lines of a file
    Get-FileTail

  15. dl — Download a file using BITS with resume support
    Start-FileDownload

Usage

To start using the PowerShell Developer Profile, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/tauseedzaman/PS1-Dev-Profile
  2. Import the profile in your PowerShell environment. Open PowerShell and run:

    notepad $PROFILE

    Add 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.

  3. Save and close the profile file. Then restart PowerShell, and you're ready to go!

Aliases

cpwd

Copies the current working directory path to the clipboard, making it easy to share or use in other commands.

pas

Starts the Laravel development server, allowing you to quickly test and preview your application.

pa

Runs 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-Folders

Example:

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 Documents

If 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

ex

Opens the current working directory in File Explorer

b

Go 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>

Contribution Guidelines

  1. Fork the repository and create a new branch for your feature or fix.
  2. Write a clear and concise commit message describing your changes.
  3. Open a pull request to merge your changes into the main branch.

License

This repository is licensed under the MIT License.

About

PowerShell Profile that every developer should have :).

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors