Pages

Showing posts with label powershell. Show all posts
Showing posts with label powershell. Show all posts

Wednesday, June 15, 2022

Powershell Append or Add Text into File

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 }

Tuesday, October 5, 2021

Powershell Remove-Item Fast

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

Monday, April 2, 2018

How to delete files in folder using powershell

How to delete files in folder using powershell
Open Powershell

Run Command : Remove-Item –path c:\testfolder\* –recurse

* means any

ShareThis