powershell:有没有人试图在Windows 2000服务器上安装PowerShell?

时间:2022-09-25 23:22:47

Has anyone tried installing powershell on a Windows 2000 server? I realize its not supposed to be installed on windows 2000 server and therefore not supported; however the vbscript that runs on it takes 3.5 days to complete which powershell could probably finish in lesser time. Nevertheless, I noticed it just requires .NET 2.0 to run.

有没有人尝试在Windows 2000服务器上安装PowerShell?我意识到它不应该安装在Windows 2000服务器上,因此不支持;然而,运行它的vbscript需要3.5天才能完成,而powershell可能会在较短的时间内完成。不过,我注意到它只需要运行.NET 2.0。

thanks in advance.

提前致谢。

2 个解决方案

#1


If you have administrator access to the Windows 2000 server in question, you could run PowerShell on a supported machine in the same domain and use set-location to change your working directory to the remote server

如果您具有相关Windows 2000服务器的管理员访问权限,则可以在同一域中的受支持计算机上运行PowerShell,并使用set-location将工作目录更改为远程服务器

cd \\remoteserver\<drive>$\path\to\folder\you\want\to\start\in

You could then run whatever PowerShell script you want on the remote directory. If the folder you are starting in is shared, it is even simpler (you won't need to access the admin share). Or you could map a drive on your machine with PowerShell that links to the target directory.

然后,您可以在远程目录上运行所需的任何PowerShell脚本。如果您正在启动的文件夹是共享的,则更简单(您不需要访问管理员共享)。或者,您可以使用链接到目标目录的PowerShell在计算机上映射驱动器。

This might be a smoother option than forcing an install on a non-supported machine.

这可能比在不受支持的计算机上强制安装更顺畅。

#2


Yes. This works. Instead of installing Powershell on the server, just remotely talk to it like :-

是。这很有效。而不是在服务器上安装Powershell,只需远程对话就像: -

Set-Location "\\MyServer\D$\wwwportal\MyChangedFileFolder\" 
Get-ChildItem -filter *.txt -Recurse

#1


If you have administrator access to the Windows 2000 server in question, you could run PowerShell on a supported machine in the same domain and use set-location to change your working directory to the remote server

如果您具有相关Windows 2000服务器的管理员访问权限,则可以在同一域中的受支持计算机上运行PowerShell,并使用set-location将工作目录更改为远程服务器

cd \\remoteserver\<drive>$\path\to\folder\you\want\to\start\in

You could then run whatever PowerShell script you want on the remote directory. If the folder you are starting in is shared, it is even simpler (you won't need to access the admin share). Or you could map a drive on your machine with PowerShell that links to the target directory.

然后,您可以在远程目录上运行所需的任何PowerShell脚本。如果您正在启动的文件夹是共享的,则更简单(您不需要访问管理员共享)。或者,您可以使用链接到目标目录的PowerShell在计算机上映射驱动器。

This might be a smoother option than forcing an install on a non-supported machine.

这可能比在不受支持的计算机上强制安装更顺畅。

#2


Yes. This works. Instead of installing Powershell on the server, just remotely talk to it like :-

是。这很有效。而不是在服务器上安装Powershell,只需远程对话就像: -

Set-Location "\\MyServer\D$\wwwportal\MyChangedFileFolder\" 
Get-ChildItem -filter *.txt -Recurse