gpt4 book ai didi

Powershell 打印奇怪的值

转载 作者:行者123 更新时间:2023-12-02 22:59:32 24 4
gpt4 key购买 nike

时不时地,我的 powershell 脚本会在下方打印出蓝色。我重新检查了很多次,但没有函数或脚本来打印它。有人可以帮我吗是 powershell 的预期行为吗?

PSPath            : Microsoft.PowerShell.Core\FileSystem::\\SOMEDIR\
PSParentPath : Microsoft.PowerShell.Core\FileSystem::\\SOMEDIR\
PSChildName : SOMEFILENAME
PSProvider : Microsoft.PowerShell.Core\FileSystem
PSIsContainer : True
Name : SOMEFILENAME
Parent : Archieve
Exists : True
Root : \\SOMEDIR
FullName : \\SOMEDIR\
Extension :
CreationTime : 17/05/2013 4:05:15 PM
CreationTimeUtc : 17/05/2013 6:05:15 AM
LastAccessTime : 17/05/2013 4:05:15 PM
LastAccessTimeUtc : 17/05/2013 6:05:15 AM
LastWriteTime : 17/05/2013 4:05:15 PM
LastWriteTimeUtc : 17/05/2013 6:05:15 AM
Attributes : Directory
BaseName : SOMEFILENAME
Mode : d----

下面是可疑的 powershell 片段:

foreach ($file in Get-ChildItem $path*.* -Include *.csv){ 

if (!(Test-Path $archieveFolder) )
{
#1. Create config archieve directory
New-Item -Path $archieveFolder -Force -ItemType Directory
}
}

最佳答案

New-Item 输出它创建的项目。如果您不想要它,请转换为 [Void] 或将其通过管道传递给 Out-Null。

New-Item -Path $archieveFolder -Force -ItemType Directory | Out-Null

关于Powershell 打印奇怪的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16602659/

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