1

Closed

Invoke-Elevated / su error

description

When I run an Invoke-Elevated command the resultant elevated PS window reports an error which implies that the command line has been repeated without the initial letter.
 
e.g.:
Invoke-Elevated Get-ChildItem
 
reoprts
 
nvoke-elevated : The term 'nvoke-elevated' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:143
  • ... .ProviderPath; nvoke-elevated Get-ChildItem}
  • ~~~~~~~~~~~~~~
    • CategoryInfo : ObjectNotFound: (nvoke-elevated:String) [], Comm
      andNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
Closed Oct 17, 2013 at 3:26 PM by r_keith_hill

comments

PeteB wrote Sep 6, 2012 at 1:59 PM

If I use the "su" alias the error reports "u : The term 'u' is not recognized..."

r_keith_hill wrote Sep 6, 2012 at 2:40 PM

Which version of PSCX are you using?

PeteB wrote Sep 6, 2012 at 5:06 PM

2.0.0.1

PeteB wrote Sep 14, 2012 at 9:01 AM

I've downloaded the latest 2.1beta for PS 3 and the command now emits errors in the powershell I run invoke-elevated/su from (the elevated command still runs):

PS C:\Source> su Get-ChildItem
Index was outside the bounds of the array.
At C:\Program Files (x86)\PowerShell Community Extensions\Pscx3\Pscx\Modules\Utility\Pscx.Utility.psm1:538 char:31
  • $cmdArgs = $args[1..$($args.Length)]
  • ~~~~~~~~~~~~
    • CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException
    • FullyQualifiedErrorId : System.IndexOutOfRangeException
or


PS C:\Source> su notepad
Index was outside the bounds of the array.
At C:\Program Files (x86)\PowerShell Community Extensions\Pscx3\Pscx\Modules\Utility\Pscx.Utility.psm1:538 char:31
  • $cmdArgs = $args[1..$($args.Length)]
  • ~~~~~~~~~~~~
    • CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException
    • FullyQualifiedErrorId : System.IndexOutOfRangeException
Property 'Count' cannot be found on this object. Make sure that it exists.
At C:\Program Files (x86)\PowerShell Community Extensions\Pscx3\Pscx\Modules\Utility\Pscx.Utility.psm1:541 char:17
  • if ($cmdArgs.Count -eq 0)
  • ~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
    • FullyQualifiedErrorId : PropertyNotFoundStrict

r_keith_hill wrote Sep 14, 2012 at 2:41 PM

The updated bits haven't been uploaded yet. We're in the process of setting up to code sign the 3.0 installer and all the scripts. I complete the first pass through last night that seems to work. Should be uploading new bits in the next couple of days.