SYNTAX ERROR: Fun with Powershell commands copied from Blogs or KB-solutions

by butsch 12. February 2022 02:37

 SYNTAX ERROR: Fun with Powershell commands copied from Blogs or KB-solutions

 

  

We often see that the "-symbol or the minus-symbol are malformed and it looks normal in notepad.exe or the PS-console. The "-symbol effect can be devastation because you may have other objects you handle with identical short names in complex commands.

Worst case: "room 140 left wing Barcelona" and he targets room then etc.

Several times we have seen such effects with Powershell if we copy PS commands direct and don't use the copy-code function that good blog platforms or even KB-platforms on Intranet should support.

   

Here is a sample:

You just see red. First you think the command is not there anymore in this version whatever. Then you think maybe the wrong shell 32/64? Or elevated. The you type it manual and it works ;-)

If you copy the two commands to NOTEPAD.EXE as it opens all looks fine.

You can see in WinWord already that there MUST be a difference (They are not exact the same horizontal length) ;-)

TO really see: If you open the two commands in Notepadd+ or any advanced editor.

 

 

   

Euro? Germany? So someone from European Union made the Blog (Not UK not Swiss/Switzerland/Suisse) no? ;-) A double minus or triple minus?

;-)

   

   

   

   

  

Tags:

Client Management

Comments are closed

Werbung von Drittfirmen (Nicht Butsch Informatik):

Werbung von Drittfirmen via Google Adsense: