You are not logged in.
Because PowerShell supports Tab Completion you need to be careful about copying and pasting TAB characters (which most often sneak in before comments).
Example:
Function demo() {
} # comment
^ That line is }<space><tab> #
when copied/pasted onto the powershell command line:
PS C:\batch> Function demo() {
>> } .\aaardvaark.cmd# comment
>>
The term '.\aaardvaark.cmd#' is not recognized as the name of a cmdlet, function, script file...
What is happening is that the space-tab gets expanded to match the first file in the current directory, in this case aaardvaark.cmd. If the sequence had been <space><tab><space> and the first file had been a PowerShell script or an executable then it would actually be run.
If your white space cosists of nothing but <space> characters (or nothing but <tab> characters) then this will never occur.
Offline
hi
thanks for sharing Simon,
This behavior can be solved by editing and changing the function tabexpansion in V2 and with the new tokenizer AST in V3 i think this "problem" is easy to resolve.
sorry for my english
Offline