$size=("{0:N2}"-f ($subFolderItems.sum /1GB)) 保留小数点后两位$size=[math]::truncate($disk.size/1GB) 截取小数点,保留整数 $date=get-date).TOSTRING("yyyy-dd-MM")$servers= get-adcomputer -Filter{Name-Like"GAGA*"-orName-Like"WENDY*"} -SearchScope Subtree -SearchBase"DC=WENDY,DC=...
You can use PowerShell to calculate the exact size of a specific folder in Windows (recursively, including all subfolders). This way you can quickly find out the size of the directory on disk without using third-party tools such asTreeSizeorWinDirStat. In addition, PowerShell gives you more ...
Using File Explorer is one way to get to know the size of a folder, but it can take some time to get the exact size, especially if it is relatively larger. Use the "Get-ChildItem [PathToFolder] | Measure-Object -Property Length -sum" command in PowerShel
Get-WmiObject -Class win32_logicaldisk | Format-Table DeviceId, MediaType, @{n="Size";e={[math]::Round($_.Size/1GB,2)}},@{n="FreeSpace";e={[math]::Round($_.FreeSpace/1GB,2)}} Step 2: Once done, then hit the Enter button. It will offer free space for all drives in GB....
Get-ChildItem "C:\Path\To\Folder" | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item 删除在过去 30 天之前修改的文件。Remove-Item 是PowerShell 中非常强大的删除命令,支持删除单个或多个文件/文件夹,支持递归删除、强制删除、以及按时间删除等多种功能。理解这些功能并...
param( [Parameter(Mandatory)] [ValidateScript( {$_ -ge (Get-Date)}, ErrorMessage = "{0} isn't a future date. Specify a later date." )] [datetime]$EventDate ) 當指定的值是過去的日期時,會傳回自定義錯誤訊息。 Output 複製 Cannot validate argument on parameter 'EventDate...
To generate the log files, replace <Path> with an output folder, and then run the following command: PowerShell Copy Connect-ExchangeOnline -EnableErrorReporting -LogDirectoryPath <Path> -LogLevel All Cmdlets in the Exchange Online PowerShell module The EXO module contains nine exclusive Get-...
Get one or more folders in the console. Syntax PowerShell Copy Get-CMFolder [[-Name] <String>] [-InputObject <IResultObject>] [-ParentFolderPath <String>] [-TypeName <String>] [-IsEmpty <Boolean>] [-IsSearchFolder <Boolean>] [-SiteCode <String>] [-DisableWildcardHandling] [-Force...
"Folder Name"Sort by Folder Name(param)Ascending In the table above, (param) depicts the usage of the-Descendingparameter. Parameter-Descending A switch to control how directories get sorted in the HTML Directory Size Report. Please see the-Sortparameter above for further details. By default Ge...
My disk gets full several times and i have to clean it manually. so , is there is any script which can tell me which folder is consuming more than 10gb with its location. i tried this one - ... "Get-ChildItem -path "C:\junk" -Directory-force -Recurse | sort -descending -propert...