Powershell Append or Add Text into File
- Without Get-Content
- Dynamic call/execute command
$text = "texthere"
$cmd = "Add-Content -Path C:\xxx.txt -Value ""$text"""
for ($i = 0; $i -lt 1000; $i++) { Invoke-Expression $cmd }
- Without Get-Content
- Dynamic call/execute command
$text = "texthere"
$cmd = "Add-Content -Path C:\xxx.txt -Value ""$text"""
for ($i = 0; $i -lt 1000; $i++) { Invoke-Expression $cmd }
Remove item in Windows via GUI will take some time because it will scan all files before delete.
To speed up time, we don't need to scan it.
One of fast method is using Powershell
Remove-Item -path ./* -recurse