forked from jayharris/dotfiles-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NuGet_profile.ps1
53 lines (42 loc) · 1.37 KB
/
NuGet_profile.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Profile for the Visual Studio Shell, only. (e.g. Package Manager Console)
# ===========
Push-Location (Split-Path -parent $profile)
"components-nuget" | Where-Object {Test-Path "$_.ps1"} | ForEach-Object -process {Invoke-Expression ". .\$_.ps1"}
Pop-Location
function Reinstall-Package {
param(
[Parameter(Mandatory = $true)]
[string]
$Id,
[Parameter(Mandatory = $true)]
[string]
$Version,
[Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[string]
$ProjectName,
[switch]
$Force
)
if (-not $ProjectName) { $ProjectName = (get-project).ProjectName }
Uninstall-Package -ProjectName $ProjectName -Id $Id -Force:$Force
Install-Package -ProjectName $ProjectName -Id $Id -Version $Version
}
# Wire StudioShell Functions if Exists
if ((Get-Module -ListAvailable StudioShell) -ne $null) {
Import-Module StudioShell
<#
function Reset-MultiMonitor {
invoke-item DTE:\WindowConfigurations\MultiMonitor
}
function Reset-SingleMonitor {
invoke-item DTE:\WindowConfigurations\SingleMonitor
}
$localMonitors = get-wmiobject -namespace root\WMI -computername localhost -Query "Select * from WmiMonitorID"
if ($localMonitors.length -gt 1) {
reset-multimonitor
} else {
reset-singlemonitor
}
Remove-Variable $localMonitors
#>
}