如何在 powershell 中运行与别名同名的可执行文件?

Jus*_*ing 5 powershell command-line

sc.exe是一个用于在 Windows 上操作服务的命令行工具。例如,要列出计算机上的所有服务,您可以sc query从命令提示符中键入。但是,如果您从 powershell 执行此操作,它会执行Set-Content,因为 sc 是 Set-Content 的别名。Even& sc会执行别名。

如何从 powershell 提示符运行 sc.exe?

Jus*_*ing 4

您有两个选择,可以使用cmd /c sc querysc.exe query