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

Update Import-VcIntuneApplication.ps1 #163

Merged
merged 1 commit into from
Mar 17, 2024
Merged
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
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 @@
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 @@
}

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
Loading