@@ -431,7 +431,7 @@ class SqlRSSetup : ResourceBase
431431 # Verify that the instance name is valid.
432432 if ($properties.InstanceName -notin @ (' SSRS' , ' PBIRS' ))
433433 {
434- New-ArgumentException - ArgumentName ' InstanceName' - Message $this.localizedData.InstanceName_Invalid
434+ New-ArgumentException - ArgumentName ' InstanceName' - Message ( $this.localizedData.InstanceName_Invalid -f $properties .InstanceName )
435435 }
436436
437437 # Verify that AcceptLicensingTerms is specified for Install and Repair actions.
@@ -450,10 +450,17 @@ class SqlRSSetup : ResourceBase
450450 Assert-BoundParameter @assertBoundParameterParameters
451451
452452 # Verify that MediaPath is valid.
453- if (-not (Test-Path - Path $properties.MediaPath ) -or ( Get-Item - Path $properties .MediaPath ).Extension -ne ' .exe ' )
453+ if (-not (Test-Path - Path $properties.MediaPath ))
454454 {
455455 New-ArgumentException - ArgumentName ' MediaPath' - Message (
456- $this.localizedData.MediaPath_Invalid -f $this.MediaPath
456+ $this.localizedData.MediaPath_Invalid -f $properties.MediaPath
457+ )
458+ }
459+
460+ if ((Test-Path - Path $properties.MediaPath ) -and (Get-Item - Path $properties.MediaPath ).Extension -ne ' .exe' )
461+ {
462+ New-ArgumentException - ArgumentName ' MediaPath' - Message (
463+ $this.localizedData.MediaPath_DoesNotHaveRequiredExtension -f $properties.MediaPath
457464 )
458465 }
459466
@@ -464,7 +471,7 @@ class SqlRSSetup : ResourceBase
464471 }
465472
466473 # EditionUpgrade requires either ProductKey or Edition for Install and Repair actions.
467- if ($properties.Action -in @ (' Install ' , ' Repair' ) -and $properties.EditionUpgrade -and -not ($properties.ProductKey -or $properties.Edition ))
474+ if ($properties.Action -in @ (' Repair' ) -and $properties.EditionUpgrade -and -not ($properties.ProductKey -or $properties.Edition ))
468475 {
469476 New-ArgumentException - ArgumentName ' EditionUpgrade' - Message $this.localizedData.EditionUpgrade_RequiresKeyOrEdition
470477 }
0 commit comments