Forum Discussion
monkeybradders
Jan 15, 2025Copper Contributor
help with remediation
 Hi, i'm trying to create detection and remediation scripts for intune to detect the presence of a template in the users word startup folder   **My detection is as follows**  $path = "C:\Users\$env:US...
jstrong013
Jan 16, 2025Copper Contributor
Based off of very quick and brief glance, I think you need to update your code: 
if ( (Test-Path $path )-eq $true ) {
  Write-Output "File exists: $path"
  exit 1
}
## My Remediation 
if ( (Test-Path $path) -eq $true ) {
	Remove-Item -Path $path -Force
}