ps/Modules/Cole.PowerShell.Developer/Public/Get-ProgramDataPath.ps1

18 lines
435 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
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"
}
}