为什么 powershell(ise) 有时会打印出我执行的代码? [英] Why powershell(ise) sometimes prints out the code I execute?

查看:31
本文介绍了为什么 powershell(ise) 有时会打印出我执行的代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

powershell ise 有时会打印出我的源代码,如果我有的话:

The powershell ise sometimes prints out my source code, if I have:

function f
{
  $a=2
}
$a

它打印:

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

为什么这么奇怪?

推荐答案

如果您不保存文件,则代码会写入控制台窗口.如果您的文件被保存,它只是被执行.然后你会看到像

If you are not saving your files, the code is written down into the console window. If your file is saved, it is just executed. You will then see the execution path like

C:\Users\vics> C:\Users\vics\Documents\test.ps1
...

这篇关于为什么 powershell(ise) 有时会打印出我执行的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆