Yor*_*ubs 32 console powershell
我不介意微软的营销,但是当我只想要一个干净的 PowerShell 提示时,这很烦人。有没有人找到一种方法可以在不删除基本版权信息的情况下只抑制Try the new cross-platform PowerShell https://aka.ms/pscore6打开 PowerShell ?我用谷歌搜索了很多,但没有找到答案(我知道有一种方法可以抑制一切,但我只想摆脱那个 pscore6 广告)。Windows PowerShell, Copyright (C) Microsoft Corporation. All rights reserved.
Eug*_*ich 30
由于Windows Terminal 1.0 已发布,因此您可以改用它。在设置中添加一个标志-NoLogo,如下所示:
"list": [
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe -NoLogo",
"hidden": false
},
Run Code Online (Sandbox Code Playgroud)
Jer*_*ert 14
此消息是嵌入在资源字符串的一部分Microsoft.PowerShell.ConsoleHost的ManagedEntranceStrings.resources资源。完整的信息是
版权所有 (C) 微软公司。版权所有。
尝试新的跨平台 PowerShell https://aka.ms/pscore6
这是一个字符串,而不是两个,并且没有选择不同横幅的逻辑。
因为字符串是作为资源读取的,理论上您可以创建一个新的资源程序集并将其放入C:\Windows\System32\WindowsPowerShell\v1.0\en-US. 实际上你不能(即使你愿意将新文件放在系统目录中),因为主程序集是强命名的并安装在 GAC 中,这意味着你不能生成一个附属程序集加载,因为您没有签名所需的私钥。然而,它确实有效——我通过构建这样一个延迟签名的程序集来验证这一点,但显然这在生产系统上并不是一个真正可行的想法。
pro*_*365 14
您可以通过在 cmd 中运行此启动 powershell 来摆脱版权横幅:
Powershell.exe -NoLogo -NoExit
Run Code Online (Sandbox Code Playgroud)
-NoExit 正如@Albin 所说,没有必要,您可以从中创建桌面快捷方式/批处理文件。
将 settings.json 中的命令行参数替换为:
\n"commandline": "powershell.exe -NoLogo -NoExit -Command Write-Host Windows PowerShell`nCopyright `(C`) Microsoft Corporation. All rights reserved.`n",\nRun Code Online (Sandbox Code Playgroud)\n\n它会禁用原始文本,并写入我们需要的内容。\n如果您想编写其他内容,请用于`n换行,并且不要忘记添加`转义保留符号,例如括号。
不同语言示例:
\n"commandline": "powershell.exe -NoLogo -NoExit -Command Write-Host Windows PowerShell`n`(C`) \xd0\x9a\xd0\xbe\xd1\x80\xd0\xbf\xd0\xbe\xd1\x80\xd0\xb0\xd1\x86\xd0\xb8\xd1\x8f \xd0\x9c\xd0\xb0\xd0\xb9\xd0\xba\xd1\x80\xd0\xbe\xd1\x81\xd0\xbe\xd1\x84\xd1\x82 `(Microsoft Corporation`). \xd0\x92\xd1\x81\xd0\xb5 \xd0\xbf\xd1\x80\xd0\xb0\xd0\xb2\xd0\xb0 \xd0\xb7\xd0\xb0\xd1\x89\xd0\xb8\xd1\x89\xd0\xb5\xd0\xbd\xd1\x8b.`n",\nRun Code Online (Sandbox Code Playgroud)\n