Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #148

Merged
merged 4 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/validate-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
- name: Upload to Codecov
id: codecov
if: always()
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./CodeCoverage-${{ matrix.os }}.xml
Expand Down
19 changes: 12 additions & 7 deletions VcRedist/Private/Import-MdtModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ function Import-MdtModule {
$MdtInstallDir = Resolve-Path -Path $MdtReg.Install_Dir
$MdtModule = [System.IO.Path]::Combine($MdtInstallDir, "bin", "MicrosoftDeploymentToolkit.psd1")
if (Test-Path -Path $mdtModule -ErrorAction "SilentlyContinue") {
Write-Verbose -Message "Loading MDT module from: $MdtInstallDir."
$params = @{
Name = $MdtModule
ErrorAction = "Stop"
Force = if ($Force) { $true } else { $false }
try {
Write-Verbose -Message "Loading MDT module from: $MdtInstallDir."
$params = @{
Name = $MdtModule
ErrorAction = "Stop"
Force = if ($Force) { $true } else { $false }
}
Import-Module @params
Write-Output -InputObject $true
}
catch {
throw $_
}
Import-Module @params
Write-Output -InputObject $true
}
else {
$Msg = "Unable to find the MDT PowerShell module at $MdtModule. Ensure the Microsoft Deployment Toolkit is installed and try again."
Expand Down
34 changes: 13 additions & 21 deletions VcRedist/Private/New-MdtDrive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,19 @@ function New-MdtDrive {
# Set a description to be applied to the new MDT drive
$Description = "MDT drive created by $($MyInvocation.MyCommand)"

if ($mdtDrives = Get-MdtPersistentDrive | Where-Object { ($_.Path -eq $Path) -and ($_.Description -eq $Description) }) {
Write-Verbose -Message "Found MDT drive: $($mdtDrives[0].Name)"
$output = $mdtDrives[0].Name
}
else {
if ($PSCmdlet.ShouldProcess("$($Drive): to $($Path)", "Mapping")) {
$params = @{
Name = $Drive
PSProvider = "MDTProvider"
Root = $Path
#NetworkPath = $Path
Description = $Description
ErrorAction = "Stop"
}
New-PSDrive @params | Add-MDTPersistentDrive

# Return the MDT drive name
$psDrive = Get-MdtPersistentDrive | Where-Object { $_.Path -eq $Path -and $_.Name -eq $Drive }
Write-Verbose -Message "Found: $($psDrive.Name)"
$output = $psDrive.Name
if ($PSCmdlet.ShouldProcess("$($Drive): to $($Path)", "Mapping")) {
$params = @{
Name = $Drive
PSProvider = "MDTProvider"
Root = $Path
Description = $Description
ErrorAction = "Stop"
}
New-PSDrive @params | Add-MDTPersistentDrive

# Return the MDT drive name
$psDrive = Get-MdtPersistentDrive | Where-Object { $_.Path -eq $Path -and $_.Name -eq $Drive }
Write-Verbose -Message "Found: $($psDrive.Name)"
Write-Output -InputObject $psDrive.Name
}
Write-Output -InputObject $output
}
4 changes: 2 additions & 2 deletions VcRedist/Public/Import-VcMdtApplication.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ function Import-VcMdtApplication {
# Set variables
Write-Verbose -Message "processing: '$($VcRedist.Name) $($VcRedist.Architecture)'."
$supportedPlatform = if ($VcRedist.Architecture -eq "x86") {
@("All x86 Windows 7 and Newer", "All x64 Windows 7 and Newer")
$null
}
else {
@("All x64 Windows 7 and Newer")
@("All x64 Windows 10 Client", "All x64 Windows Server 10")
}

# Check for existing application by matching current VcRedist
Expand Down
16 changes: 8 additions & 8 deletions VcRedist/VisualCRedistributables.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
},
{
"Name": "Visual C++ Redistributable for Visual Studio 2019",
"ProductCode": "{2c673fb6-3e65-4751-965d-33d30b68a8a6}",
"Version": "14.29.30139.0",
"ProductCode": "{9057ceb3-ab14-4d3a-aa99-38d2d660e604}",
"Version": "14.29.30153.0",
"URL": "https://www.visualstudio.com/downloads/",
"URI": "https://aka.ms/vs/16/release/VC_redist.x64.exe",
"Release": "2019",
Expand All @@ -119,8 +119,8 @@
},
{
"Name": "Visual C++ Redistributable for Visual Studio 2019",
"ProductCode": "{8d5fdf81-7022-423f-bd8b-b513a1050ae1}",
"Version": "14.29.30139.0",
"ProductCode": "{e3aefa8b-a2ea-42b8-a384-95f2ff6df681}",
"Version": "14.29.30153.0",
"URL": "https://www.visualstudio.com/downloads/",
"URI": "https://aka.ms/vs/16/release/VC_redist.x86.exe",
"Release": "2019",
Expand All @@ -132,8 +132,8 @@
},
{
"Name": "Visual C++ Redistributable for Visual Studio 2022",
"ProductCode": "{8bdfe669-9705-4184-9368-db9ce581e0e7}",
"Version": "14.36.32532.0",
"ProductCode": "{1de5e707-82da-4db6-b810-5d140cc4cbb3}",
"Version": "14.38.33130.0",
"URL": "https://www.visualstudio.com/downloads/",
"URI": "https://aka.ms/vs/17/release/VC_redist.x64.exe",
"Release": "2022",
Expand All @@ -145,8 +145,8 @@
},
{
"Name": "Visual C++ Redistributable for Visual Studio 2022",
"ProductCode": "{410c0ee1-00bb-41b6-9772-e12c2828b02f}",
"Version": "14.36.32532.0",
"ProductCode": "{2cfeba4a-21f8-4ea7-9927-c5a5c6f13cc9}",
"Version": "14.38.33130.0",
"URL": "https://www.visualstudio.com/downloads/",
"URI": "https://aka.ms/vs/17/release/VC_redist.x86.exe",
"Release": "2022",
Expand Down
Loading