当我将函数{}
放在我的powershell脚本周围时,要更改注册表项,脚本似乎不会在括号内运行。当我取出Function {}时,脚本运行正常。我在这里缺少什么?
Function ClearPageFile
{
$regpath = "HKLM:\SYSTEM....(rest of path)"
$key = "ClearPageFileAtShutdown
Set-ItemProperty -Path $regpath -Name $key -Value 0
}
答案 0 :(得分:0)
除非你在其他地方调用这个功能,否则这里是你的答案......
#include <iostream>
using namespace std;
int main() {
char ch;
do {
//print menu here
cin >> ch; // take in one char only
//perform action based on ch
} while (ch != '9');
return 0;
}