Hello if i run the following command I get a response of TRUE which is correct
Test-Path -Path "\\LT609247\c$\Users\*\AppData\Local\Microsoft\Outlook\*Internet Calendar*.pst"
However when I run the following commad in a script I get two FALSE returns. The iCalendar_Audit.csv contains two workstations one of which is LT609247.
$Computers = Get-Content c:\temp\iCalendar_Audit.csv
ForEach ($Computer in $Computers)
{ $ADComputer = $null
$ADComputer = Get-ADComputer $Computer
If ($ADComputer)
{
Add-Content c:\temp\iCalendar_Audit.log -Value "Found $Computer, checking for iCalendar"
Test-Path -Path "\\$ADComputer\c$\Users\*\AppData\Local\Microsoft\Outlook\*Internet Calendar*.pst"
}
}