PowerShell Helper scripts to manage NuGet packages.
- 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 .\PackageHelper.psm1
- Now you can use the methods from your PowerShell session
- 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
Update Nuspec config to match the same versions specified in app.config.
Update Nuspec.config in current directory
Update-Nuspec
Update Nuspec.config by path
Update-Nuspec -Path 'C:\git\PowerShell\EnvironmentVariables\'
Update Nuspec.config by repository name
Update-Nuspec -Repository 'EnvironmentVariables'
Find all package(s) that match the specified pattern.
Get all packages for current directory
Find-Package
Get Microsoft packages for current directory
Find-Package -Pattern '*Microsoft*'
Get all packages by path
Update-Nuspec -Path 'C:\git\PowerShell\EnvironmentVariables\'
Get Microsoft packages for current directory
Find-Package -Path 'C:\git\PowerShell\EnvironmentVariables\' -Pattern '*Microsoft*'
Get packages by major versionfor current directory
Find-Package -Path 'C:\git\PowerShell\EnvironmentVariables\' -Pattern '*2.*'
Get packages by major/minor version for current directory
Find-Package -Path 'C:\git\PowerShell\EnvironmentVariables\' -Pattern '*2.1*'
Get all packages for repository name
Find-Package -Repository 'EnvironmentVariables'
Get Microsoft packages for repository name
Find-Package -Repository 'EnvironmentVariables' -Pattern '*Microsoft*'
Get packages by major version for repository name
Find-Package -Repository 'EnvironmentVariables' -Pattern '*2.*'
Get packages by major/minor version for repository name
Find-Package -Repository 'EnvironmentVariables' -Pattern '*2.1*'