I am running a script in powershell in multiple threads (multiple shells), and I'm finding that its possible for the NewGuid powershell function to generate values in powershell 7 that are not actually unique when run at the same time.
"${env:TEMP}\some_unique_file_$([guid]::NewGuid()).json"
The above can produce a conflict when I'd like each string here to be unique. Is there something missing or is this a bug? It's almost as if PID is not considered when generating a GUID.
for further context, its also possible because its defined as a parameter default, that this is causing the issue:
param (
[Parameter(Mandatory = $false)] [string]$houdiniEnvFile = "${env:TEMP}\some_unique_file_$([guid]::NewGuid()).json"
)