Why does powershell (ise) sometimes print the code I execute?

PowerShell sometimes outputs the source code if I have:

function f { $a=2 } $a 

He prints:

 C:\Users\vics> function f { $a=2 } $a 

Why is it so tense?

+5
source share
1 answer

If you do not save your files, the code is written to the console window. If your file is saved, it just executes. Then you will see the execution path, for example

 C:\Users\vics> C:\Users\vics\Documents\test.ps1 ... 
+7
source

Source: https://habr.com/ru/post/1244280/


All Articles