@@ -24,6 +24,9 @@ public override bool HandleFlag(string key, bool value)
2424 case "dry-run" :
2525 SkipExtraction = value ;
2626 return true ;
27+ case "skip-psmodulepath-files" :
28+ SkipPSModulePathFiles = value ;
29+ return true ;
2730 default :
2831 return base . HandleFlag ( key , value ) ;
2932 }
@@ -127,6 +130,12 @@ private static FileInfo[] GetDefaultFiles()
127130 /// </summary>
128131 public bool SkipExtraction { get ; private set ; } = false ;
129132
133+ /// <summary>
134+ /// Whether to extract files in the paths found in the `PSModulePath`
135+ /// environment variable.
136+ /// </summary>
137+ public bool SkipPSModulePathFiles { get ; private set ; } = false ;
138+
130139 /// <summary>
131140 /// Whether errors were encountered parsing the arguments.
132141 /// </summary>
@@ -158,13 +167,14 @@ public static void ShowHelp(System.IO.TextWriter output)
158167 "PowerShell# standalone extractor\n \n Extracts PowerShell scripts in the current directory.\n "
159168 ) ;
160169 output . WriteLine ( "Additional options:\n " ) ;
161- output . WriteLine ( " <path> Use the provided path instead." ) ;
170+ output . WriteLine ( " <path> Use the provided path instead." ) ;
162171 output . WriteLine (
163- " --exclude:xxx Exclude a file or directory (can be specified multiple times)"
172+ " --exclude:xxx Exclude a file or directory (can be specified multiple times)"
164173 ) ;
165- output . WriteLine ( " --dry-run Stop before extraction" ) ;
166- output . WriteLine ( " --threads:nnn Specify number of threads (default=CPU cores)" ) ;
167- output . WriteLine ( " --verbose Produce more output" ) ;
174+ output . WriteLine ( " --dry-run Stop before extraction" ) ;
175+ output . WriteLine ( " --threads:nnn Specify number of threads (default=CPU cores)" ) ;
176+ output . WriteLine ( " --verbose Produce more output" ) ;
177+ output . WriteLine ( " --skip-psmodulepath-files Avoid extracting source files in paths specified by the PSModulePath environment variable." ) ;
168178 }
169179
170180 private Options ( ) { }
0 commit comments