Nunc aliquet aliquet augue, ut laoreet mauris. Donec volutpat, leo eu ultricies bibendum, odio nisi sodales metus, eget dignissim massa ligula vel lectus. Fusce sit amet facilisis sem. Morbi vitae sagittis velit, a laoreet nunc. Aenean nibh ex, imperdiet vel faucibus eu, ultricies sit amet lacus. Aenean sed neque hendrerit, porttitor nibh ac, ornare nisl. Maecenas mi lacus, dapibus ac urna at, egestas elementum ante.
Table of Contents:
PowerShell Profile
The PowerShell profile (Microsoft.PowerShell_profile.ps1) is a script file that loads every time a new PowerShell session starts, allowing users to customize their PowerShell environment. This file is typically located in a specific user directory, and PowerShell supports multiple profile files for different scopes (e.g., for all users or just the current user).
By editing the profile file, users can automate repetitive tasks, set environment variables, define custom aliases, functions, and even change the appearance of the terminal, such as setting custom colors or prompts. The profile is a powerful tool for personalizing and streamlining the PowerShell experience, making the user's workflow more efficient by tailoring the shell to specific needs.
Folder Shortcuts
No one likes having to type a long path when using the cd command. If you have folders you find your are constantly accessing, it just makes sense to setup some aliases through functions in our profile file.
The beauty of this is because we are referencing the environment variabl $HOME for our home directory, it means no matter where we are in our file and folder structure simply typing docs will take us back to our documents.
function docs {
cd $HOME/Documents/
}
function code {
cd $HOME/Documents/Code
}
function itsterminal {
cd $HOME/Documents/Code/Django/itsterminal
}
As you can see in the last function i've setup a alias to take me straight to a Django project folder. I usually always setup an alias for any projects im working on regularly.
Find Files And Other Utilities
Nunc aliquet aliquet augue, ut laoreet mauris. Donec volutpat, leo eu ultricies bibendum, odio nisi sodales metus, eget dignissim massa ligula vel lectus. Fusce sit amet facilisis sem. Morbi vitae sagittis velit, a laoreet nunc. Aenean nibh ex, imperdiet vel faucibus eu, ultricies sit amet lacus. Aenean sed neque hendrerit, porttitor nibh ac, ornare nisl. Maecenas mi lacus, dapibus ac urna at, egestas elementum ante.
function find-file($name) {
ls -recurse -filter "*${name}" -ErrorAction SilentlyContinue | foreach {
$place_path = $_.directory echo "${place_path}\${_}"
}
}