Added ValidateScript block to Path parameter for Import-Excel

This commit is contained in:
Brian Addicks
2016-03-30 08:07:40 -04:00
parent beda832c73
commit 3c5381182f

View File

@@ -29,6 +29,7 @@ function Import-Excel {
param(
[Alias("FullName")]
[Parameter(ValueFromPipelineByPropertyName=$true, ValueFromPipeline=$true, Mandatory=$true)]
[ValidateScript({ Test-Path $_ -PathType Leaf })]
$Path,
[Alias("Sheet")]
$WorkSheetname=1,