I have a PowerShell script that receives live log data and writes it into a file which contains a timestamp in the filename. Locally my script is running fine but when I run it in a docker container I get the following error message:
Out-File: /app/myscript.ps1:13
Could not find a part of the path
| '/app/myapp-logs/live-logfile-10/05/2022-14/12.txt'.
Here the relevant line of my code:
cf logs myapp > ".\myapp-logs\live-logfile-$(Get-Date -Format "dd/MM/yyyy-HH/mm").txt"
I'm using the latest ubuntu base image and the Powershell Version: 7.2.3-1.deb.