Skip to content

Commit

Permalink
Merge pull request #59 from aaronparker/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
aaronparker authored Apr 6, 2020
2 parents 5be1625 + fbb3a76 commit a652e45
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 16 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# VcRedist

[![License][license-badge]][license]
[![GitHub Release][github-release-badge]][github-release]
[![PowerShell Gallery Version][psgallery-version-badge]][psgallery]
[![PowerShell Gallery][psgallery-badge]][psgallery]

Expand All @@ -10,7 +9,7 @@

## About

VcRedist is PowerShell module for downloading and installing the [Microsoft Visual C++ Redistributables](https://support.microsoft.com/en-au/help/2977003/the-latest-supported-visual-c-downloads). The module also supports creating applications in the Microsoft Deployment Toolkit or System Center Configuration Manager to install the Redistributables.
VcRedist is a PowerShell module for lifecycle management of the [Microsoft Visual C++ Redistributables](https://support.microsoft.com/en-au/help/2977003/the-latest-supported-visual-c-downloads). VcRedist downloads the supported (and unsupported) Redistributables, for local install, master image deployment or importing as applications into the Microsoft Deployment Toolkit or Microsoft Endpoint Configuration Manager. Supports passive and silent installs and uninstalls of the Visual C++ Redistributables.

### Visual C++ Redistributables

Expand All @@ -37,7 +36,5 @@ Install-Module -Name VcRedist -Force
[psgallery-version]: https://www.powershellgallery.com/packages/vcredist
[gitbooks-badge]: https://www.gitbook.com/button/status/book/aaronparker/vcredist/
[gitbooks-build]: https://www.gitbook.com/book/aaronparker/vcredist
[github-release-badge]: https://img.shields.io/github/release/aaronparker/Install-VisualCRedistributables.svg?style=flat-square&logo=github
[github-release]: https://github.com/aaronparker/Install-VisualCRedistributables/releases/latest
[license-badge]: https://img.shields.io/github/license/aaronparker/Install-VisualCRedistributables.svg?style=flat-square
[license]: https://github.com/aaronparker/vcredist/blob/master/LICENSE
10 changes: 9 additions & 1 deletion VcRedist/Public/Save-VcRedist.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,15 @@ Function Save-VcRedist {
$ProxyCredential = [System.Management.Automation.PSCredential]::Empty
)

Begin { }
Begin {
# Disable the Invoke-WebRequest progress bar for faster downloads
If ($PSBoundParameters.ContainsKey('Verbose')) {
$ProgressPreference = "Continue"
}
Else {
$ProgressPreference = "SilentlyContinue"
}
}

Process {
# Loop through each Redistributable and download to the target path
Expand Down
10 changes: 5 additions & 5 deletions VcRedist/VcRedist.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CompanyName = 'stealthpuppy'
Copyright = '(c) 2019 stealthpuppy. All rights reserved.'

# Description of the functionality provided by this module
Description = 'A module for lifecycle management of the Microsoft Visual C++ Redistributables. Downloads the supported (and unsupported) Redistributables locally, for local install, master image deployment or importing as applications into the Microsoft Deployment Toolkit or System Center Configuration Manager. Supports passive and silent installs of the Visual C++ Redistributables.'
Description = 'A module for lifecycle management of the Microsoft Visual C++ Redistributables. VcRedist downloads the supported (and unsupported) Redistributables, for local install, master image deployment or importing as applications into the Microsoft Deployment Toolkit or Microsoft Endpoint Configuration Manager. Supports passive and silent installs and uninstalls of the Visual C++ Redistributables.'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
Expand Down Expand Up @@ -75,13 +75,13 @@ FunctionsToExport = @('Export-VcManifest', 'Get-InstalledVcRedist', 'Get-VcList'
'Uninstall-VcRedist', 'Update-VcMdtApplication', 'Update-VcMdtBundle')

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
# CmdletsToExport = @()

# Variables to export from this module
# VariablesToExport = @()
VariablesToExport = @('VcManifest')

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = 'Get-VcRedist', 'Export-VcXml', 'Import-VcCmApp', 'Import-VcMdtApp'
AliasesToExport = @('Get-VcRedist', 'Export-VcXml', 'Import-VcCmApp', 'Import-VcMdtApp')

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand All @@ -101,7 +101,7 @@ PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'Redistributables','VisualC','VisualStudio','MDT','ConfigMgr','SCCM'
Tags = 'Redistributables','VisualC','VisualStudio','MDT','ConfigMgr','SCCM', 'MEMCM'

# A URL to the license for this module.
LicenseUri = 'https://github.com/aaronparker/VcRedist/blob/master/LICENSE'
Expand Down
7 changes: 5 additions & 2 deletions VcRedist/VcRedist.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.SYNOPSIS
VcRedist script to initiate the module
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
Param ()

Expand All @@ -22,5 +24,6 @@ ForEach ($import in @($public + $private)) {
}
}

# Export the public modules and aliases
Export-ModuleMember -Function $public.Basename -Alias *
# Export the public functions, aliases and variables
[System.String] $VcManifest = Join-Path -Path $PSScriptRoot -ChildPath "VisualCRedistributables.json"
Export-ModuleMember -Function $public.Basename -Alias * -Variable VcManifest
8 changes: 4 additions & 4 deletions VcRedist/VisualCRedistributables.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@
},
{
"Name": "Visual C++ Redistributable for Visual Studio 2019",
"ProductCode": "{282975d8-55fe-4991-bbbb-06a72581ce58}",
"Version": "14.24.28127.4",
"ProductCode": "{6913e92a-b64e-41c9-a5e6-cef39207fe89}",
"Version": "14.25.28508.3",
"URL": "https://www.visualstudio.com/downloads/",
"Download": "https://aka.ms/vs/16/release/VC_redist.x64.exe",
"Release": "2019",
Expand All @@ -158,8 +158,8 @@
},
{
"Name": "Visual C++ Redistributable for Visual Studio 2019",
"ProductCode": "{e31cb1a4-76b5-46a5-a084-3fa419e82201}",
"Version": "14.24.28127.4",
"ProductCode": "{65e650ff-30be-469d-b63a-418d71ea1765}",
"Version": "14.25.28508.3",
"URL": "https://www.visualstudio.com/downloads/",
"Download": "https://aka.ms/vs/16/release/VC_redist.x86.exe",
"Release": "2019",
Expand Down
37 changes: 37 additions & 0 deletions tests/UpdateManifest.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<#
.SYNOPSIS
Private Pester function tests.
#>
[OutputType()]
Param ()

$Manifest = Get-Content -Path $VcManifest | ConvertFrom-Json
$Installed = Get-InstalledVcRedist

$2019Installed = $Installed | Where-Object { $_.Release -eq "2019" }
$2019Manifest = $Manifest.Supported | Where-Object { $_.Release -eq "2019" }


ForEach ($VcRedist in $Manifest.Supported) {
$Item = $Installed | Where-Object { ($_.Release -eq $VcRedist.Release) -and ($_.Architecture -eq $VcRedist.Architecture) }
If ($Item.Count -gt 0) {
If ($Item.ProductCode -ne $VcRedist.ProductCode) {
Write-Host -ForegroundColor Cyan "Comparing: [$($Item.Release)][$($Item.Architecture)]"
Write-Host -ForegroundColor Cyan "With : [$($VcRedist.Release)][$($VcRedist.Architecture)]"
#$Item
Write-Host -ForegroundColor Cyan "[$($Item.ProductCode)] does not match [$($VcRedist.ProductCode)]"
}
}
}


$Item = $Installed | Where-Object { ($_.Release -eq $VcRedist.Release) -and ($_.Architecture -eq $VcRedist.Architecture) }
If ($Item.Count -gt 0) {
If ($Item.ProductCode -ne $VcRedist.ProductCode) {
Write-Host -ForegroundColor Cyan "Comparing: [$($Item.Release)][$($Item.Architecture)]"
Write-Host -ForegroundColor Cyan "With : [$($VcRedist.Release)][$($VcRedist.Architecture)]"
#$Item
Write-Host -ForegroundColor Cyan "[$($Item.ProductCode)] does not match [$($VcRedist.ProductCode)]"
}
}

0 comments on commit a652e45

Please sign in to comment.