PSCredentialStore/src/Private/Get-TempDir.ps1
Marco Blessing 7708df9b66
Update pwsh style to latest community standards (#52)
* update pwsh style in store files

* update pwsh style in item files

* update pwsh style in connection files

* update pwsh style in certificate files

* update pwsh style in private files

* update pwsh style in drone helper

* update meta

* fix pwsh style

* fix output type

* fix typo in OutputType

* update appveyor build mode

* debugging build mode

* wip

* test windows pipeline

* fix typo

* simplify drone setup

* update readme

* remove deprecated cicd setup

* update pwsh style
2022-06-28 08:56:33 +02:00

42 lines
828 B
PowerShell

function Get-TempDir {
<#
.SYNOPSIS
Returns the valid temp dir of the current OS
.DESCRIPTION
Returns the valid temp dir of the current OS.
.INPUTS
[None]
.OUTPUTS
[string]
.EXAMPLE
Get-TempDir
#>
[CmdletBinding()]
[OutputType([string])]
param ()
begin {}
process {
if ($IsLinux) {
return (Resolve-Path -Path '/tmp/').Path
}
if ($IsMacOS) {
return (Resolve-Path -Path '/tmp/').Path
}
elseif (
($isWindows) -or
($PSVersionTable.PSVersion.Major -lt 6) -or
($PSVersionTable.PSEdition -eq 'Desktop')
) {
return (Resolve-Path -Path $env:TEMP).Path
}
}
end {}
}