大众.NET 发表于 2012-12-17 21:31:09

PowerShell中一个分号引发的问题

<div id="cnblogs_post_body">今天在用start-process这个cmdlet去新开一个窗口执行powershell的时候遇到的一个问题
看一下测试代码:
以下这个ps代码命名为profile.ps1,并且保存在%UserProfile%\My Documents\WindowsPowerShell这个目录下
它就相当于是运行powershell时自动加载的脚本,代码如下
<div class="cnblogs_code">function print {    Param(      $param1="default1"            $param2="default2"   )         write-host $param1   write-host $param2   Read-Host }
页: [1]
查看完整版本: PowerShell中一个分号引发的问题