首页 > 解决方案 > Select–String :术语“Select–String”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称

问题描述

我正在尝试在 Windows 8.1 pro 中完全卸载 sql server 2016 实例,但出现此选择字符串错误。这是代码:

    `$a = c:\temp\msiinv.exe -s | Select–String "SQL Server" -Context 1,1;
     $a = $a -replace "Product code:    ","msiexec /x """;
     $a = $a -replace ">", "rem";
     $a = $a -replace "\t", "";
     $a = $a -replace "}","}""";
     $a | Out-File c:\temp\remove.bat -encoding ascii;`

由于设置不当,我之前曾两次安装和卸载服务器实例,现在我希望将其从我的机器中完全删除。检查下面 的 ss-在此处输入图像描述 PS 我正在使用最新版本的 WindowsPS 和 .netfw v4.8

标签: sql-serverpowershell-4.0

解决方案


推荐阅读