]> git.ardis.lu - ArdisUtilities/commitdiff
Fix rootFolder logic
authorArdis Lu <ardisglu@gmail.com>
Sun, 12 Dec 2021 05:09:20 +0000 (21:09 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sun, 12 Dec 2021 05:09:20 +0000 (21:09 -0800)
It should get the command root and not the script file root.

ArdisUtilities/ArdisUtilities.psm1

index 698acac7670de64368be4ccf5638ca6ffd310c0f..e6440f21c7b86fd9a4026cf7be6b1c0e4b4f5de8 100644 (file)
@@ -57,7 +57,7 @@ function Invoke-RandomFile {
     $documentExtensions = @('*.txt', '*.doc', '*.docx', '*.pdf')
 
     # Define the folder in which this command was executed
-    $rootFolder = Split-Path $script:MyInvocation.MyCommand.Path
+    $rootFolder = (Get-Location).Path
   }
 
   process {
This page took 0.032041 seconds and 4 git commands to generate.