1- using System ;
21using System . Collections . Generic ;
32using System . IO ;
43using System . Linq ;
@@ -25,9 +24,6 @@ public override bool HandleFlag(string key, bool value)
2524 case "dry-run" :
2625 SkipExtraction = value ;
2726 return true ;
28- case "skip-psmodulepath-files" :
29- SkipPSModulePathFiles = value ;
30- return true ;
3127 default :
3228 return base . HandleFlag ( key , value ) ;
3329 }
@@ -78,7 +74,7 @@ public override void InvalidArgument(string argument)
7874 /// <summary>
7975 /// List of extensions to include.
8076 /// </summary>
81- public IList < string > Extensions { get ; } = new List < string > ( ) { ".ps1" , ".psd1" } ;
77+ public IList < string > Extensions { get ; } = new List < string > ( ) { ".ps1" } ;
8278
8379 /// <summary>
8480 /// Files/patterns to exclude.
@@ -121,24 +117,6 @@ private static FileInfo[] GetDefaultFiles()
121117 }
122118 }
123119
124- /// <summary>
125- /// Returns true if the extractor should skip files in the PSModulePath because the
126- /// environment variable CODEQL_EXTRACTOR_POWERSHELL_OPTION_SKIP_PSMODULEPATH_FILES
127- /// is set to a truthy value.
128- /// </summary>
129- private static bool GetDefaultSkipPSModulePathFiles ( )
130- {
131- var skip = System . Environment . GetEnvironmentVariable (
132- "CODEQL_EXTRACTOR_POWERSHELL_OPTION_SKIP_PSMODULEPATH_FILES"
133- ) ;
134- bool b = skip != null && skip . ToLower ( ) != "false" ;
135- if ( b )
136- {
137- System . Console . WriteLine ( "Skipping files in PSModulePath" ) ;
138- }
139- return b ;
140- }
141-
142120 /// <summary>
143121 /// The directory or file containing the source code;
144122 /// </summary>
@@ -149,12 +127,6 @@ private static bool GetDefaultSkipPSModulePathFiles()
149127 /// </summary>
150128 public bool SkipExtraction { get ; private set ; } = false ;
151129
152- /// <summary>
153- /// Whether to extract files in the paths found in the `PSModulePath`
154- /// environment variable.
155- /// </summary>
156- public bool SkipPSModulePathFiles { get ; private set ; } = GetDefaultSkipPSModulePathFiles ( ) ;
157-
158130 /// <summary>
159131 /// Whether errors were encountered parsing the arguments.
160132 /// </summary>
@@ -186,18 +158,13 @@ public static void ShowHelp(System.IO.TextWriter output)
186158 "PowerShell# standalone extractor\n \n Extracts PowerShell scripts in the current directory.\n "
187159 ) ;
188160 output . WriteLine ( "Additional options:\n " ) ;
189- output . WriteLine ( " <path> Use the provided path instead." ) ;
190- output . WriteLine (
191- " --exclude:xxx Exclude a file or directory (can be specified multiple times)"
192- ) ;
193- output . WriteLine ( " --dry-run Stop before extraction" ) ;
194- output . WriteLine (
195- " --threads:nnn Specify number of threads (default=CPU cores)"
196- ) ;
197- output . WriteLine ( " --verbose Produce more output" ) ;
161+ output . WriteLine ( " <path> Use the provided path instead." ) ;
198162 output . WriteLine (
199- " --skip-psmodulepath-files Avoid extracting source files in paths specified by the PSModulePath environment variable. "
163+ " --exclude:xxx Exclude a file or directory (can be specified multiple times) "
200164 ) ;
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" ) ;
201168 }
202169
203170 private Options ( ) { }
0 commit comments