Skip to content

jhonnyelhelou91/ProfileHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Profile Helpers

PowerShell Helper scripts to manage PowerShell current user profiles.

Getting Started

  • Copy the files
  • Open Command Line or PowerShell (Window + X, A)
  • If you opened Command Prompt, then type powershell in order to use PowerShell commands
  • Navigate to the scripts directory
    cd your_directory
  • Type
    Import-Module .\ProfileHelper.psm1
  • Now you can use the methods from your PowerShell session

Adding Script to Profile [Optional]

  • Enable execution policy using PowerShell Admin
    Set-ExecutionPolicy Unrestricted
  • Navigate to the profile path
    cd (Split-Path -parent $PROFILE)
  • Open the location in Explorer
    ii .
  • Create the user profile if it does not exist
    If (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
  • Import the module in the PowerShell profile
    Import-Module -Path script_directory -ErrorAction SilentlyContinue

Examples

Add-Profile Example

Create current user profile for PowerShell if it does not exist

Create Profile

Add-Profile

Import-Profile Example

Import 1 or more modules/scripts to current user PowerShell profile

Import Script to Profile

Import-Profile -Path "C:\git\PowerShell\ProfileHelpers.psm1"

Import Multiple Scripts to Profile

Import-Profile -Path "C:\git\PowerShell\"

Update-Profile Example

Reload current user profile for PowerShell after modifying in imported modules/scripts or in profile

Update Profile

Update-Profile

Add-NuGetProfile Example

Create current user NuGet profile for PowerShell if it does not exist

Create NuGet Profile

Add-NuGetProfile

Import-NuGetProfile Example

Import 1 or more modules/scripts to current user PowerShell NuGet profile

Import Script to NuGet Profile

Import-NuGetProfile -Path "C:\git\PowerShell\ProfileHelpers.psm1"

Import Multiple Scripts to Profile

Import-NuGetProfile -Path "C:\git\PowerShell\"

Update-Profile Example

Reload current user NuGet profile for PowerShell after modifying in imported modules/scripts or in NuGet profile

Update Profile

Update-NuGetProfile

About

PowerShell helper to manage PowerShell profiles

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published