Whilst dir is an alias for Get-ChildItem
, I find it best to use the full cmdlets when providing answers.
To use proper PowerShell cmdlets it would be best for you to use the following:
Get-ChildItem * -Exclude "*.txt" -File
What you see above is the PowerShell cmdlet to get all items in the path specified (using the *
assumes you want all items from the current location)
You can also use -Path
and provide the location of the path to where you want to get the items as well, such as:
Get-ChildItem -Path "C:PathFolder" -Exclude "*.txt" -File
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…