function Get-ProgramDataPath { [CmdletBinding()] param () $path = [Environment]::GetFolderPath("CommonApplicationData") if (!(Test-Path $path)) { return $path } if (Test-IsWindowsPlatform) { return $env:ProgramData } else { # Must be a macOS or Linux system # Caution, this folder may not exist if not properly setup on the system in question return "/var" } }