### Install Dotfiles with Git or Download Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Installs the dotfiles by cloning the repository and running a bootstrap script, or by downloading and executing an installation script directly. Requires unrestricted execution policy for the direct download method. ```powershell # Clone and bootstrap with Git git clone https://github.com/jayharris/dotfiles-windows.git cd dotfiles-windows . .\bootstrap.ps1 # Or install without Git (requires unrestricted execution policy) Set-ExecutionPolicy Unrestricted iex ((new-object net.webclient).DownloadString('https://raw.github.com/jayharris/dotfiles-windows/master/setup/install.ps1')) ``` -------------------------------- ### Install Dependencies and Packages (PowerShell) Source: https://github.com/jayharris/dotfiles-windows/blob/master/README.md Installs common packages, utilities, and dependencies required for a new Windows machine setup. This includes Node.js packages via NPM, Win-Get packages, Windows Features, and Tools. ```PowerShell .\deps.ps1 ``` -------------------------------- ### Start IIS Express Server with Start-IISExpress Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Starts the IIS Express web server, allowing configuration of the website path and port. It can be used with default settings or custom parameters for flexible local development. ```powershell # Start with defaults (current directory, port 3000) Start-IISExpress # Specify custom path and port Start-IISExpress -path "C:\Projects\webapp" -port 8080 # Start in current directory on custom port Start-IISExpress -port 5000 ``` -------------------------------- ### Install Development Dependencies with deps.ps1 Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Installs a suite of common development tools, browsers, and configures Node.js packages. It utilizes Win-Get for package management and npm for Node.js tools. ```powershell # Run dependencies installation (requires administrator) .\deps.ps1 # Installs via Win-Get: # - Git, Node.js, Python 3.12, Ruby 3.2 # - Chrome, Firefox # - PowerShell, SQL Server Management Studio # - Vim, Azure CLI, Azure Storage Explorer # Installs via npm: # - yo (Yeoman) # Also installs Janus for Vim if prerequisites available ``` -------------------------------- ### Launch Visual Studio with VS Functions Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Offers functions to launch Visual Studio, optionally opening a specific solution file or launching as an administrator. It can also install Visual Studio extensions from a URL. ```powershell # Launch Visual Studio (opens .sln in current directory if found) vs # Launch with specific solution vs "MyProject.sln" Start-VisualStudio "C:\Projects\App\App.sln" # Launch as administrator vsadmin Start-VisualStudioAsAdmin "MyProject.sln" # Install VS extension from URL Install-VSExtension "https://marketplace.visualstudio.com/extension.vsix" ``` -------------------------------- ### Install Dotfiles Git-Free (PowerShell) Source: https://github.com/jayharris/dotfiles-windows/blob/master/README.md Installs the dotfiles without requiring Git by downloading and executing a remote PowerShell script. Requires an unrestricted execution policy. Running this command again serves as an update mechanism. ```PowerShell iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/jayharris/dotfiles-windows/master/setup/install.ps1')) ``` -------------------------------- ### Execute Remote Installation Script Source: https://github.com/jayharris/dotfiles-windows/blob/master/README.md A PowerShell command executed via the command line to download and run the installation script from a remote URL. It uses the WebClient object to fetch the script content and executes it using the Invoke-Expression (iex) cmdlet. ```bash iex ((new-object net.webclient).DownloadString('https://raw.github.com/$account/$repo/$branch/setup/install.ps1')) ``` -------------------------------- ### Clone and Bootstrap Dotfiles (PowerShell) Source: https://github.com/jayharris/dotfiles-windows/blob/master/README.md Clones the dotfiles repository and runs the bootstrap script to copy files to the PowerShell Profile folder. Requires Git to be installed. The execution policy must be set to unrestricted or bypass. ```PowerShell git clone https://github.com/jayharris/dotfiles-windows.git; cd dotfiles-windows; . .\bootstrap.ps1 ``` -------------------------------- ### Configure Repository Variables in PowerShell Source: https://github.com/jayharris/dotfiles-windows/blob/master/README.md Defines the GitHub account, repository name, and branch variables used by the installation script. These values must be updated when forking the repository to point to your own custom configuration. ```powershell $account = "jayharris" $repo = "dotfiles-windows" $branch = "master" ``` -------------------------------- ### Check Command Existence and Execute Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Checks if a command exists in the system's PATH and executes a command if it does. This is useful for conditional execution based on installed software. ```powershell # Check if a command exists if (which ruby) { gem update } ``` -------------------------------- ### Apply Sensible Windows Defaults (PowerShell) Source: https://github.com/jayharris/dotfiles-windows/blob/master/README.md Applies default configurations and settings to a Windows machine. This includes options like showing hidden files, configuring privacy settings, installing IIS, and uninstalling unwanted applications. It can also be used to rename the machine. ```PowerShell .\windows.ps1 ``` -------------------------------- ### Control Sound Volume with PowerShell Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Provides cmdlets to control system audio volume and mute state using Windows Core Audio APIs. Functions include getting current volume, setting volume to a specific level, and muting/unmuting the system audio. ```powershell # Get current volume (returns 0-100) Get-SoundVolume # Output: 65 # Set volume to specific level Set-SoundVolume 75 Set-SoundVolume -Volume 100 # Mute and unmute using aliases mute # Set-SoundMute unmute # Set-SoundUnmute # Or use full cmdlet names Set-SoundMute Set-SoundUnmute ``` -------------------------------- ### Refresh Environment Variables with Refresh-Environment Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Reloads all environment variables from the Windows registry into the current PowerShell session without requiring a restart. This is particularly useful after installing new software or modifying system paths, ensuring changes are immediately recognized. ```powershell # After installing software that modifies PATH winget install Git.Git Refresh-Environment # Now git is available without restarting PowerShell git --version ``` -------------------------------- ### Create and Enter Directory with mkd Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Combines the functionality of creating a new directory and changing into it with a single command. This utility streamlines the process of setting up new project folders or subdirectories. ```powershell # Create and enter a new project directory mkd "C:\Projects\new-app" # Now in C:\Projects\new-app # Works with relative paths too CreateAndSet-Directory "src\components" ``` -------------------------------- ### Configure Secrets with Environment Variables Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Demonstrates how to securely store sensitive configuration, such as Git and Mercurial credentials or API keys, in a separate 'extra.ps1' file that is not tracked by Git. It uses 'Set-Environment' to manage environment variables. ```powershell # Create ~/Documents/WindowsPowerShell/extra.ps1 # Example content: # Git credentials Set-Environment "GIT_AUTHOR_NAME" "Your Name" Set-Environment "GIT_COMMITTER_NAME" $env:GIT_AUTHOR_NAME Set-Environment "GIT_AUTHOR_EMAIL" "you@example.com" Set-Environment "GIT_COMMITTER_EMAIL" $env:GIT_AUTHOR_EMAIL git config --global user.name $env:GIT_AUTHOR_NAME git config --global user.email $env:GIT_AUTHOR_EMAIL # Mercurial credentials Set-Environment "EMAIL" "Your Name " # Custom tokens or API keys Set-Environment "GITHUB_TOKEN" "ghp_xxxxxxxxxxxx" ``` -------------------------------- ### Navigation Shortcuts for Directory Traversal Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Provides convenient aliases for navigating the directory structure, inspired by Unix conventions. These include shortcuts for moving up multiple parent directories and accessing common user folders like Desktop, Documents, and Downloads. ```powershell # Parent directory navigation .. # cd .. ... # cd ..\.. .... # cd ..\..\.. ..... # cd ..\..\..\.. # Common locations ~ # cd ~ dt # cd ~/Desktop docs # cd ~/Documents dl # cd ~/Downloads drop # cd ~/Documents/Dropbox ``` -------------------------------- ### Configure Secrets and Credentials (PowerShell) Source: https://github.com/jayharris/dotfiles-windows/blob/master/README.md Sets environment variables and Git configurations for credentials, such as email addresses. This script is intended to be placed in `extra.ps1` and is not tracked by Git to prevent accidental commits of sensitive information. ```PowerShell # Hg credentials # Not in the repository, to prevent people from accidentally committing under my name Set-Environment "EMAIL" "Jay Harris " # Git credentials # Not in the repository, to prevent people from accidentally committing under my name Set-Environment "GIT_AUTHOR_NAME" "Jay Harris","User" Set-Environment "GIT_COMMITTER_NAME" $env:GIT_AUTHOR_NAME git config --global user.name $env:GIT_AUTHOR_NAME Set-Environment "GIT_AUTHOR_EMAIL" "jay@aranasoft.com" Set-Environment "GIT_COMMITTER_EMAIL" $env:GIT_AUTHOR_EMAIL git config --global user.email $env:GIT_AUTHOR_EMAIL ``` -------------------------------- ### Manage Environment PATH with Path Functions Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Provides functions to add directories to the system's PATH environment variable. It supports prepending or appending paths and includes options to only add directories if they exist. ```powershell # Prepend to PATH Prepend-EnvPath "C:\tools\bin" # Append to PATH Append-EnvPath "C:\custom\scripts" # Only add if directory exists Prepend-EnvPathIfExists "C:\Program Files\Custom Tool" Append-EnvPathIfExists "C:\optional\bin" ``` -------------------------------- ### Run Commands as Administrator with sudo Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Provides a 'sudo' command to elevate any subsequent command to run with administrator privileges, mimicking Unix sudo functionality. It can be used for single commands or commands with arguments, and is internally used by other utilities like 'Edit-Hosts'. ```powershell # Run a single command as administrator sudo notepad # Run a command with arguments as administrator sudo netsh advfirewall set allprofiles state off # Edit the hosts file (uses sudo internally) Edit-Hosts ``` -------------------------------- ### System-Update - Comprehensive System Update Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Performs a full system update across multiple package managers and sources, including Windows Update, Windows Store apps, Win-Get packages, PowerShell modules, and optionally Ruby gems and npm packages. It automates the update process for a streamlined maintenance routine. ```powershell # Run full system update System-Update # What it does internally: # - Install-WindowsUpdate -IgnoreUserInput -IgnoreReboot -AcceptAll # - Update-WindowsStore # - winget upgrade --all # - Update-Module # - Update-Help -Force # - gem update --system && gem update (if Ruby installed) # - npm install npm -g && npm update -g (if Node.js installed) ``` -------------------------------- ### Download File to Temp Directory with curlex Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Downloads a file from a given URL to the system's temporary directory using the 'curlex' function. It returns a FileInfo object representing the downloaded file. ```powershell # Download a file $file = curlex "https://example.com/installer.exe" Write-Output $file.FullName # Output: C:\Users\username\AppData\Local\Temp\installer.exe # Download and execute $installer = curlex "https://example.com/setup.msi" Start-Process msiexec -ArgumentList "/i $($installer.FullName) /quiet" ``` -------------------------------- ### Locate Command Path with which Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Finds and displays the full path to the executable or script file for a given command, similar to the Unix 'which' command. This is useful for verifying command availability and understanding execution paths. ```powershell # Find where a command is defined which git ``` -------------------------------- ### Configure Windows Defaults with windows.ps1 Source: https://context7.com/jayharris/dotfiles-windows/llms.txt A script to configure various Windows settings, including privacy, Explorer behavior, taskbar options, and removal of bloatware applications. This script typically requires administrator privileges to run. ```powershell # Run Windows configuration (requires administrator) .\windows.ps1 # Key configurations applied: # - Disable advertising ID and telemetry # - Show hidden files and file extensions # - Hide taskbar Search, Task View, Widgets, Chat buttons # - Remove bloatware apps (Candy Crush, Cortana, Xbox, etc.) # - Configure disk cleanup settings # - Set PowerShell console colors (Jellybeans theme) ``` -------------------------------- ### Empty Recycle Bin with Empty-RecycleBin Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Empties the Recycle Bin for all drives on the system without requiring user confirmation. An alias 'emptytrash' is also provided for convenience. ```powershell # Empty all recycle bins Empty-RecycleBin # Using the alias emptytrash ``` -------------------------------- ### Run Disk Cleanup with Clean-Disks Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Executes the Windows Disk Cleanup utility with predefined settings. This function automates the cleanup process, potentially requiring administrator privileges to run 'cleanmgr.exe'. ```powershell # Run disk cleanup with saved settings Clean-Disks # Using the alias cleandisks # Requires administrator privileges - runs cleanmgr.exe /sagerun:6174 ``` -------------------------------- ### Calculate Directory Size with Get-DiskUsage Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Determines the size of a specified file or the total size of a directory, presenting the output in a human-readable format. An alias 'fs' is also provided for convenience. ```powershell # Get size of current directory Get-DiskUsage # Output: 125M # Get size of specific path Get-DiskUsage "C:\Projects\myapp" # Output: 2.4G # Using the alias fs fs "C:\Windows\Temp" ``` -------------------------------- ### Update Dotfiles (PowerShell) Source: https://github.com/jayharris/dotfiles-windows/blob/master/README.md Updates the local dotfiles by re-running the bootstrap script. This command should be executed from within the local dotfiles-windows directory in PowerShell. Requires Git and an unrestricted execution policy. ```PowerShell . .\bootstrap.ps1 ``` -------------------------------- ### Set Permanent Environment Variables with Set-Environment Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Sets environment variables permanently in the Windows registry and immediately loads them into the current PowerShell session. This is useful for configuring application paths, editor preferences, and Git credentials. ```powershell # Set permanent environment variable Set-Environment "EDITOR" "gvim --nofork" Set-Environment "GIT_EDITOR" $Env:EDITOR # Configure Git credentials (typically in extra.ps1) Set-Environment "GIT_AUTHOR_NAME" "Jay Harris" Set-Environment "GIT_COMMITTER_NAME" $env:GIT_AUTHOR_NAME Set-Environment "GIT_AUTHOR_EMAIL" "jay@example.com" Set-Environment "GIT_COMMITTER_EMAIL" $env:GIT_AUTHOR_EMAIL ``` -------------------------------- ### Extract ZIP Archives with Unzip-File Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Extracts the contents of a ZIP archive to a specified location. It supports extraction to the current directory, a custom destination, and can be used with PowerShell pipelines for batch processing. ```powershell # Extract to current directory Unzip-File -File "archive.zip" # Extract to specific destination Unzip-File -File "C:\Downloads\package.zip" -Destination "C:\Projects\extracted" # Pipeline support 'archive.zip' | Unzip-File # Batch extraction Get-ChildItem -Path C:\zipfiles -Filter "*.zip" | ForEach-Object { $_.FullName | Unzip-File -Destination C:\extracted } ``` -------------------------------- ### Restart PowerShell Shell with Reload-Powershell Source: https://context7.com/jayharris/dotfiles-windows/llms.txt Restarts the current PowerShell session in a new window, ensuring that all updated profile scripts and configurations are loaded. An alias 'reload' is available. ```powershell # After modifying profile scripts Reload-Powershell # Using the alias reload ``` -------------------------------- ### Rename Machine Name (PowerShell) Source: https://github.com/jayharris/dotfiles-windows/blob/master/README.md Renames the current Windows machine to a specified name using WMI. This command is typically part of the `windows.ps1` script for setting up new machines. ```PowerShell (Get-WmiObject Win32_ComputerSystem).Rename("MyMachineName") | Out-Null ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.