项目作者: jhonnyelhelou91

项目描述 :
PowerShell helper for Visual Studio Package Manager Console
高级语言: PowerShell
项目地址: git://github.com/jhonnyelhelou91/VisualStudioHelper.git
创建时间: 2019-02-25T17:40:50Z
项目社区:https://github.com/jhonnyelhelou91/VisualStudioHelper

开源协议:MIT License

下载


Visual Studio Helper

PowerShell Helper scripts to manage Service Fabric services.

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 .\VisualStudioHelper.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

Remove-BuildDirectories Example

Remove build directories


Remove bin,obj,pkg and resharper directories for local directory

Remove-BuildDirectories




Remove bin,obj,pkg and resharper directories for specific directory

Remove-BuildDirectories -Path ‘C:\git\Projects\TestProject\’




Remove specific files for specific directory

Remove-BuildDirectories -Includes ‘.pyc’ -Path ‘C:\git\Python\’




Remove all files excluding specific files

Remove-BuildDirectories -Includes ‘‘ -Excludes ‘.cs’, ‘.sln’, ‘.csproj’, ‘.sfproj’, ‘*.resx’ -Path ‘C:\git\C#\’


Register-PackageSources Example

Register package sources if the sources don’t exist


Register package sources to NuGet

Register-PackageSources -names ‘Test’, ‘Test1’ -Location ‘NuGet Feed Url for Test’, ‘NuGet Feed Url for Test1’




Register package sources to another provider

Register-PackageSources -names ‘Test’, ‘Test1’ -Location ‘Feed Url for Test’, ‘Url for Test1’ -Provider ‘MyProvider’


Enable-RemoteDebugging Example

Enable remote debugging for the current project


Enable remote debugging by host, port and directory

Enable-RemoteDebugging -Host ‘10.101.10.1’ -Port 4078 -Path ‘C:\MyServices\TestService\’


Disable-RemoteDebugging Example

Disable remote debugging for the current project


Disable remote debugging

Disable-RemoteDebugging


Get-References Example

Get references for all projects


Get all references

Get-References




Get specific references

Get-References -Regex Microsoft




Get references by version

Get-References -Regex ‘2.




Get only specific version references

Get-References -SpecificVersion $false


Remove-AllReferencePaths Example

Remove all reference paths from all projects


Remove all reference paths

Remove-AllReferencePaths


Remove-ReferencePath Example

Remove specific reference path from all projects


Remove specific reference path

Remove-ReferencePath “PACKAGE_NAME” “DLL_PATH\bin\Debug\”


Set-ReferencePath Example

Set specific reference path for all projects


Set specific reference path

Set-ReferencePath “PACKAGE_NAME” “DLL_PATH\bin\Debug\”