Downloads:
293
Downloads of v 0.1.0:
293
Last Update:
29 Jul 2017
Package Maintainer(s):
Software Author(s):
- Kim J. Nordmo
Tags:
wormie-visualstudio.extension admin visual-studio extension choco-extension- Software Specific:
- Software Site
- Software Source
- Software License
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Visual Studio Chocolatey (unofficial) extension
- 1
- 2
- 3
0.1.0 | Updated: 29 Jul 2017
- Software Specific:
- Software Site
- Software Source
- Software License
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Downloads:
293
Downloads of v 0.1.0:
293
Maintainer(s):
Software Author(s):
- Kim J. Nordmo
Visual Studio Chocolatey (unofficial) extension 0.1.0
- 1
- 2
- 3
All Checks are Passing
3 Passing Tests
This package was approved by moderator flcdrg on 17 Aug 2017.
This package is unlisted and hidden from package listings.
This package contains modules that extends Chocolatey with the ability to manage Visual Studio Extensions for Visual Studio 2017 and above.
These functions may be used in Chocolatey install/uninstall scripts by declaring this package as a dependency in your package's nuspec file.
function getSkuName() {
param([string]$displayName)
@('Enterprise';'Ultimate';'Premium';'Pro:Professional';'Community') | ? {
$valToTest = "^Visual Studio $($_ -split '\:' | select -Last 1) "
$displayName -match $valToTest
} | % { $_ -split '\:' | select -First 1 } | select -First 1
}
function getVsixData() {
param([string]$versionRange, [switch]$legacy)
function convertFrom-Xml() {
param([xml]$xml)
$nodes = $xml.SelectNodes('/instances/instance')
foreach ($node in $nodes) {
$psobject = New-Object psobject
foreach ($child in $node.ChildNodes) {
$psobject | Add-Member NoteProperty $child.Name $child.InnerText
}
if ($psobject.installationPath -and (Test-Path "$($psobject.installationPath)\Common7\IDE\VSIXInstaller.exe")) {
$psobject | Add-Member NoteProperty 'vsixInstaller' "$($psobject.installationPath)\Common7\IDE\VSIXInstaller.exe"
}
$psobject
}
}
$arguments = @(
'-format'
'xml'
'-all'
if ($versionRange) { '-version',$versionRange }
if ($legacy) { '-legacy' }
)
$vswhere = Get-Command vswhere | select -expand Source
Write-Debug "Calling vswhere with the arguments $arguments"
$data = convertFrom-Xml (. "$vswhere" $arguments) | ? { $_.vsixInstaller }
return $data
}
function Install-VisualStudioExtension() {
param(
[parameter(Mandatory = $true)][string]$packageName,
[parameter(Mandatory = $true)][string]$url,
[parameter(Mandatory = $false)][string]$checksum = '',
[parameter(Mandatory = $false)][string]$checksumType = '',
[parameter(Mandatory = $false)][string]$versionRange = $null,
[parameter(Mandatory = $false)][hashtable]$options = @{Headers=@{}},
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$fileType = 'vsix'
$chocTempDir = $env:TEMP
$tempDir = Join-Path $chocTempDir "$packageName"
if ($env:chocolateyPackageVersion -ne $null) { $tempDir = Join-Path $tempDir "$($env:chocolateyPackageVersion)" }
$tempDir = $tempDir -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'
if (![System.IO.Directory]::Exists($tempDir)) { [System.IO.Directory]::CreateDirectory($tempDir) | Out-Null }
$downloadFilePath = Join-Path $tempDir "$($packageName)Install.$fileType"
if ($url -eq '' -or $url -eq $null) {
throw "A url needs to be specified."
}
$filePath = Get-ChocolateyWebFile $packageName $downloadFilePath $url -checksum $checksum -checksumType $checksumType -options $options -getOriginalFileName
Install-VisualStudioInstallExtension $packageName $filePath $versionRange
}
$scriptDir = (Split-Path -Parent $MyInvocation.MyCommand.Definition)
function Install-VisualStudioInstallExtension() {
param(
[parameter(Mandatory = $true)][string]$packageName,
[ValidateScript( { Test-Path $_ })]
[parameter(Mandatory = $true)][string]$file,
[string]$versionRange = $null
)
. "$scriptDir\getVsixData.ps1"
. "$scriptDir\getSkuName.ps1"
if ($versionRange -and $versionRange -match "^[\[\)]?([2-9][^\d]|1[0-4])") {
$vsData = GetVsixData -versionRange $versionRange -legacy
} else {
$vsData = GetVsixData -versionRange $versionRange
}
$legacyInstalled = $false
$vsData | % {
if ($_.displayName) {
Write-Host "Installing $packageName for $($_.displayName)..."
} elseif(!$legacyInstalled) {
Write-Host "Installing $packageName for Visual Studio $($_.installationVersion) and below..."
$legacyInstalled = $true
} else { continue; }
$args = @(
"`"$file`""
if ($env:chocolateyInstallOverride -ne $true) { '/quiet' }
if ($_.displayName) { "/skuVersion:$($_.installationVersion)","/skuName:$(getSkuName $_.displayName)" }
)
Start-ChocolateyProcess -statements $args -exeToRun $_.vsixInstaller -elevate `
-ValidExitCodes @(0, 1001, 2003) # We ignore 2003 error codes (NoApplicableSKUsException)
}
}
$scriptDir = (Split-Path -Parent $MyInvocation.MyCommand.Definition)
function Uninstall-VisualStudioExtension() {
param(
[parameter(Mandatory = $true)][string]$packageName,
[parameter(Mandatory = $true)][string]$vsixId,
[string]$versionRange = $null
)
. "$scriptDir\getVsixData.ps1"
. "$scriptDir\getSkuName.ps1"
if ($versionRange -and $versionRange -match "^[\[\)]?([2-9][^\d]|1[0-4])") {
$vsData = GetVsixData -versionRange $versionRange -legacy
} else {
$vsData = GetVsixData -versionRange $versionRange
}
$legacyInstalled = $false
$vsData | % {
if ($_.displayName) {
Write-Host "Uninstalling $packageName for $($_.displayName)..."
} elseif(!$legacyInstalled) {
Write-Host "Uninstalling $packageName for Visual Studio $($_.installationVersion) and below..."
$legacyInstalled = $true
} else { continue; }
$args = @(
"/uninstall:$vsixId"
if ($env:chocolateyInstallOverride -ne $true) { '/quiet' }
if ($_.displayName) { "/skuVersion:$($_.installationVersion)","/skuName:$(getSkuName $_.displayName)" }
)
Start-ChocolateyProcess -statements $args -exeToRun $_.vsixInstaller -elevate `
-ValidExitCodes @(0, 1002, 2003) # We ignore 2003 error codes (NoApplicableSKUsException)
}
}
# Export functions that start with capital letter, others are private
# Include file names that start with capital letters, ignore others
$ScriptRoot = Split-Path $MyInvocation.MyCommand.Definition
$pre = ls Function:\*
ls "$ScriptRoot\*.ps1" | ? { $_.Name -cmatch '^[A-Z]+' } | % { . $_ }
$post = ls Function:\*
$funcs = compare $pre $post | select -Expand InputObject | select -Expand Name
$funcs | ? { $_ -cmatch '^[A-Z]+'} | % { Export-ModuleMember -Function $_ }
#Export-ModuleMember -Alias *
MIT License
Copyright (c) 2017 Kim Johansen Nordmo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Log in or click on link to see number of positives.
In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).
Chocolatey Pro provides runtime protection from possible malware.
Copyright (C) Kim J. Nordmo 2017
-
- vswhere (≥ 2.1.3)
Ground Rules:
- This discussion is only about Visual Studio Chocolatey (unofficial) extension and the Visual Studio Chocolatey (unofficial) extension package. If you have feedback for Chocolatey, please contact the Google Group.
- This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
- The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
- Tell us what you love about the package or Visual Studio Chocolatey (unofficial) extension, or tell us what needs improvement.
- Share your experiences with the package, or extra configuration or gotchas that you've found.
- If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.