This PowerShell script automates the following tasks:
- Check for Winget Installation: The script checks if Winget is installed on the system. If Winget is not installed, it prompts the user to install it.
- Install Starship Prompt: Using Winget, the script installs the Starship prompt.
- Update PowerShell Profile: The script overwrites the current PowerShell profile with the contents of a specified
myprofile.ps1
file. - Install Fonts: The script installs all fonts located in the
fonts/nerd-fonts
andfonts/coding-fonts
directories, ensuring that already installed fonts are skipped.
- Ensure that the
myprofile.ps1
file is present in the same directory as the script. - Place your font files in the
fonts/nerd-fonts
andfonts/coding-fonts
directories. - Run the script in a PowerShell session.
This script simplifies setting up a development environment by automating the installation of essential tools and configurations.
This PowerShell script checks if it is running with administrator privileges. If not, it prompts the user to continue execution. It retrieves a list of upgradable packages using winget upgrade
command, parses the output to identify available upgrades, and separates them into two categories: available upgrades and excluded upgrades based on predefined exclusion criteria.
- Administrator Privileges Check: Verifies if the script is running with administrator rights. If not, it prompts the user to confirm continuation.
- Exclusion List: Defines a list of package names (
$excludePackages
) that are excluded from the upgrade process. - Package Parsing: Parses the output of
winget upgrade
command to extract package details such as Name, Id, Current Version, and Available Version. - Output Display: Displays a clear list of available upgrades and excluded upgrades.
- User Interaction: Prompts the user to confirm if they want to proceed with upgrading the available packages.
- Upgrade Execution: Executes the upgrade commands for available packages either in regular mode or elevated mode based on user input.
- Run as Administrator: It's recommended to run this script with administrator privileges for full functionality.
- Exclusion List: Modify the
$excludePackages
array to exclude specific packages from the upgrade process. - Confirmation: Respond to prompts (
y/n
) to proceed with upgrades or cancel the operation. - Output: View detailed information about available and excluded packages before making a decision to upgrade.
- Ensure PowerShell execution policy allows running scripts (
Set-ExecutionPolicy
). - Review and update the
$excludePackages
array to match packages you want to exclude from upgrades. - For safety, always review the list of upgrades and confirm before proceeding with the upgrade process.
This PowerShell script allows you to select a file from the starship/
directory and copy it to $HOME/.config/starship.toml
. It lists all files in the starship/
folder, presents them in a numbered menu, and prompts you to choose which file to copy. After selecting a file, it creates the destination directory if it doesn't exist and copies the chosen file to $HOME/.config/starship.toml
. This script ensures you copy the correct file interactively, enhancing file management efficiency.