【发布时间】:2013-08-26 19:54:46
【问题描述】:
在我今天的电子邮件中,我收到了一封关于获取未使用的驱动器号的电子邮件。 This was their solution:
Get-ChildItem function:[d-z]: -Name | Where-Object {-not (Test-Path -Path $_)}
PowerShell Magazine BrainTeaser had this for a solution, same thing.
ls function:[d-z]: -n|?{!(test-path $_)}|random
我不知道function:[d-z]: 是如何工作的。我知道使用 'd' 到 'z' 之间的每个字符,但我不知道为什么语法有效。
测试Get-ChildItem function:[d-a]: -Name 给你一个错误说Get-ChildItem : Cannot retrieve the dynamic parameters for the cmdlet. The specified wildcard pattern is not valid:[d-a]:
那是动态参数吗? Get-Help gci -full怎么没有显示?
【问题讨论】:
标签: variables powershell dynamic