gpt4 book ai didi

Powershell 导致 : to seek when it starts; how do I stop this?

转载 作者:行者123 更新时间:2023-12-02 23:32:16 25 4
gpt4 key购买 nike

我写了一个 powershell 脚本,我已经把它变成了一个计划任务。到现在为止还挺好。我遇到的问题是,每次启动 Powershell 时,它都会导致我的软盘驱动器进行搜索;这意味着每五分钟(在任务计划中),我从软盘驱动器中得到一点“研磨”。

如何禁用此行为?

    C:\fa>powershell -noprofile    Windows PowerShell    Copyright (C) 2006 Microsoft Corporation. All rights reserved.    PS C:\fa> exit    C:\fa>

When I do this test, I get a seek when I start and when I exit. I assume the error would go away if I had a floppy disk to put in the drive.

As a poor work-around, I disabled the floppy drive in BIOS. I've removed the red herring about the drive not being available; this was because of another issue.

The suggested way to find what, in my profile, points to A:, turned up nothing.

PS C:\fa2> dir Env:\ | ?{$_.Value -like "A:\*"}
PS C:\fa2>

当然,这是在我在 BIOS 中重新启用软盘驱动器之后。

最佳答案

我会说它是在运行时发生的驱动器枚举。 Powershell 会构建一个驱动器列表并为每个驱动器创建别名,这样您就可以键入“A:”并使其像 cmd.exe 一样工作。我认为这是因为如果您在不拥有共享驱动器(由另一个节点拥有)的集群服务器上启动 Powershell,它会发出一个错误,指出该驱动器不可访问。然而,在shell中一切正常。

话虽如此,我从未在我管理的数百台机器中的任何一台上看到这种行为(软盘驱动器在加载时搜索)。

关于Powershell 导致 : to seek when it starts; how do I stop this?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/504423/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com