18 lines
435 B
PowerShell
18 lines
435 B
PowerShell
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"
|
|
}
|
|
} |