Powershell打印奇怪的值
有时,我的powershell脚本会以蓝色打印在下面。我反复检查了很多次,但我没有打印这个的函数或脚本。如果这件事发生了,有人能帮我吗 是powershell的预期行为吗Powershell打印奇怪的值,powershell,Powershell,有时,我的powershell脚本会以蓝色打印在下面。我反复检查了很多次,但我没有打印这个的函数或脚本。如果这件事发生了,有人能帮我吗 是powershell的预期行为吗 PSPath : Microsoft.PowerShell.Core\FileSystem::\\SOMEDIR\ PSParentPath : Microsoft.PowerShell.Core\FileSystem::\\SOMEDIR\ PSChildName : SOMEFI
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
}
}
新项输出它创建的项。如果您不想要它,可以将其强制转换为[Void]或通过管道将其输出为Null
New-Item -Path $archieveFolder -Force -ItemType Directory | Out-Null
不,这不是预期的。您的代码中一定有什么东西在提示发生这种情况,这将很难帮助您,因为我看不到您的代码,但请尝试在脚本中的各个点输出调试消息,以尝试锁定导致此提示的行。当您尝试
获取作业时
是否返回了任何内容?prompt
函数的定义是什么?(查看Get Content函数:\prompt
)类似“Get Item.\somedir | FL*`的函数可以返回此输出。是的,这是行,但在什么情况下返回this@Myagdi添加其余的代码。。。嫌疑犯是无辜的,我们没有证据指控他谢谢你,你应得的+50@Myagdi太好了,很乐意帮忙。如果你认为你的问题得到回答,那么接受答案是很好的。