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)
297297 return Helper . Instance . GetNamedArgumentAttributeValue ( shouldProcessAttribute ) ;
298298 }
299299
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-
323300 /// <summary>
324301 /// Checks if the given command supports ShouldProcess
325302 /// </summary>
@@ -331,7 +308,7 @@ private bool SupportsShouldProcess(string cmdName)
331308 return false ;
332309 }
333310
334- var cmdInfo = GetCommandInfo ( cmdName ) ;
311+ var cmdInfo = Helper . Instance . GetCommandInfo ( cmdName ) ;
335312 if ( cmdInfo == null )
336313 {
337314 return false ;
You can’t perform that action at this time.
0 commit comments