我试图将同事的光标贴在显示器的左上角。我正在使用do until
循环进行此操作。破坏脚本的唯一方法应该是$ FilePath有比#34; 5"更多的子项目。知道为什么这不起作用吗?
$FilePath = "I:\TRANSFER"
$test = Get-ChildItem $FilePath
do {[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(0,0)
$test.count}
until ($test.count -gt '5')
答案 0 :(得分:2)
$FilePath = "I:\TRANSFER"
[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
do {
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(0,0)
}
until ((Get-ChildItem $FilePath).count -gt '5')