i created a simple script that copies zip files from an azure vm to an azure storage account.
it then delete all files except the most recent 3 files from the storage account
the storage account is a file share that is mapped on the azure vm as y:
i can open the script and run it and it works fine.
i scheduled the script with task scheduler on that vm like many others i created but it never runs.
i found in the event viewer -> powershell this error
Provider Health: Could not find the drive 'Y:\'. The drive might not be ready or might not be mapped..
ErrorMessage=Could not find the drive 'Y:\'. The drive might not be ready or might not be mapped.
I am not sure why the script can find the y: drive when i run it manually but not when run from the task scheduler.
the task runs with highest privileges and wether user is logged on or not