noobie的Powershell问题 [英] Powershell problem for noobie

查看:72
本文介绍了noobie的Powershell问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了下面的脚本以帮助我卸载有问题的SQL Server安装,当我尝试在PS编辑器中运行它时收到错误



术语Select-String不被识别为cmdlet,函数,脚本文件或可操作程序的名称。检查名称的拼写,或者如果包含路径,请验证
路径是否正确,然后重试。
在线:1字符:40





msiinv.exe我是从同一网站上的链接下载的。这是脚本,我之前从未使用过PS而Google没有找到太多帮助





 $ a = msiinv.exe -s | Select-StringSQL Server--Context 1,1; 
$ a = $ a -replace产品代码:,msiexec / x
$ a = $ a -replace>,rem
$ a = $ a -replace\t,
$ a = $ a -replace},}
$ a | Out-File c:\ BatFiles \ remove.bat -encoding ascii





我尝试过:



以上所有以及大量的咒骂

解决方案

a = msiinv.exe -s | Select-StringSQL Server-Context 1,1;


a =


a -replace产品代码:,msiexec / x

I downloaded the script below to help me uninstall a problematic SQL Server install, when I try and run it in the PS editor I receive an error

The term 'Select–String' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that 
the path is correct and try again.
At line:1 char:40



msiinv.exe I downloaded from a link on the same site. Here is the script, I've never used PS before and Google didn't find much of help


$a = 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:\BatFiles\remove.bat -encoding ascii



What I have tried:

All of the above and lots of swearing

解决方案

a = msiinv.exe -s | Select–String "SQL Server" -Context 1,1;


a =


a -replace "Product code: ","msiexec /x """


这篇关于noobie的Powershell问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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