Skip to content

Commit

Permalink
Update Import-VcIntuneApplication.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronparker committed Mar 16, 2024
1 parent 8b2ca9d commit 55e5436
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions VcRedist/Public/Import-VcIntuneApplication.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ function Import-VcIntuneApplication {
Position = 0,
ValueFromPipeline,
HelpMessage = "Pass a VcList object from Save-VcRedist.")]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject] $VcList
)

begin {
if ([System.Boolean]$VcList.Path -eq $false) {
$Msg = "Object does not have valid Path property. Please ensure that output from Save-VcRedist is passed to this function."
throw [System.Management.Automation.PropertyNotFoundException]::New($Msg)
}

# IntuneWin32App currently supports Windows PowerShell only
if (Test-PSCore) {
$Msg = "We can't load the IntuneWin32App module on PowerShell Core. Please use PowerShell 5.1."
Expand Down Expand Up @@ -58,6 +53,12 @@ function Import-VcIntuneApplication {
}

process {
# Make sure that $VcList has the required properties
if ((Test-VcListObject -VcList $VcList) -ne $true) {
$Msg = "Required properties not found. Please ensure the output from Save-VcRedist is sent to this function. "
throw [System.Management.Automation.PropertyNotFoundException]::New($Msg)

Check warning on line 59 in VcRedist/Public/Import-VcIntuneApplication.ps1

View check run for this annotation

Codecov / codecov/patch

VcRedist/Public/Import-VcIntuneApplication.ps1#L58-L59

Added lines #L58 - L59 were not covered by tests
}

foreach ($VcRedist in $VcList) {

# Package MSI as .intunewin file
Expand Down

0 comments on commit 55e5436

Please sign in to comment.