Skip to content

Commit

Permalink
Merge pull request #163 from aaronparker/development
Browse files Browse the repository at this point in the history
Update Import-VcIntuneApplication.ps1
  • Loading branch information
aaronparker authored Mar 17, 2024
2 parents 8b2ca9d + 55e5436 commit c0e1069
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)
}

foreach ($VcRedist in $VcList) {

# Package MSI as .intunewin file
Expand Down

0 comments on commit c0e1069

Please sign in to comment.