File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change @@ -297,29 +297,6 @@ private bool DeclaresSupportsShouldProcess(FunctionDefinitionAst ast)
297
297
return Helper . Instance . GetNamedArgumentAttributeValue ( shouldProcessAttribute ) ;
298
298
}
299
299
300
- /// <summary>
301
- /// Get a CommandInfo object of the given command name
302
- /// </summary>
303
- /// <returns>Returns null if command does not exists</returns>
304
- private CommandInfo GetCommandInfo ( string cmdName )
305
- {
306
- try
307
- {
308
- using ( var ps = System . Management . Automation . PowerShell . Create ( ) )
309
- {
310
- var cmdInfo = ps . AddCommand ( "Get-Command" )
311
- . AddArgument ( cmdName )
312
- . Invoke < CommandInfo > ( )
313
- . FirstOrDefault ( ) ;
314
- return cmdInfo ;
315
- }
316
- }
317
- catch ( System . Management . Automation . CommandNotFoundException )
318
- {
319
- return null ;
320
- }
321
- }
322
-
323
300
/// <summary>
324
301
/// Checks if the given command supports ShouldProcess
325
302
/// </summary>
@@ -331,7 +308,7 @@ private bool SupportsShouldProcess(string cmdName)
331
308
return false ;
332
309
}
333
310
334
- var cmdInfo = GetCommandInfo ( cmdName ) ;
311
+ var cmdInfo = Helper . Instance . GetCommandInfo ( cmdName ) ;
335
312
if ( cmdInfo == null )
336
313
{
337
314
return false ;
You can’t perform that action at this time.
0 commit comments