hello,
I am trying to delete files and folders from specific directory like entire $item (including the folder and its subcontents) has to be deleted from $workingFolderPath
> Get-ChildItem -Path "$WorkingFolderPath" -Directory -Filter "$item" -Verbose 4>&1 | Remove-Item -Recurse -Confirm:$false -Force -ea SilentlyContinue -Verbose 4>&1|Out-File -Append "$LogPath\log.txt"
Eg:
D:\Workingfolder\abcdefg.upm_2020-07-01_16.17.58\UPM_Profile\AppData\Local\Microsoft\Windows\AppCache\0X0SYCQF\1\precompiled-default~addon-graph-deferredoperations~channel-files~external-files~personal-files~recent-files~spad~0037f0bc.min.c9c856d1cb32abc8[1].js
$workingfolderpath is d:\workingfolderpath ; $item is abcdefg.upm_2020-07-01_16.17.58
I was able to view these files when I uncheck the option " Hide protected os files" from folder options.
Could you please suggest mea way to delete such folder containing long tree or long path.
Also please help me to log the verbose operations from the above command. I am unable to log them.
your help is much appreciated. Thanks in advance