]> git.ardis.lu - ArdisUtilities/commitdiff
Improve error message for ValidateScript
authorArdis Lu <ardisglu@gmail.com>
Fri, 24 Dec 2021 05:39:14 +0000 (21:39 -0800)
committerArdis Lu <ardisglu@gmail.com>
Fri, 24 Dec 2021 05:39:14 +0000 (21:39 -0800)
ArdisUtilities/ArdisUtilities.psm1

index 3d121e463161754827d945d03918075bc391b9f7..40393ef8f887df5e8a683aceb41899dd51d0c5b6 100644 (file)
@@ -46,7 +46,7 @@ function Invoke-RandomFile {
     [String]$FileCategory = 'all',
 
     [Parameter(ValueFromRemainingArguments)] # Allows dragging a subfolder to the shortcut to pass it as a parameter
-    [ValidateScript({ Test-Path -LiteralPath $_ })]
+    [ValidateScript({ Test-Path -LiteralPath $_ }, ErrorMessage = "'{0}' is not a valid path.")]
     [String]$SearchFolder
   )
 
This page took 0.048068 seconds and 4 git commands to generate.