PortValhalla/scripts/lib/System.ps1

17 lines
402 B
PowerShell
Raw Normal View History

2024-08-05 18:07:39 +00:00
<#
.SYNOPSIS
Creates a new temporary directory.
#>
function New-TemporaryDirectory {
$path = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName());
New-Item -ItemType Directory $path;
}
<#
.SYNOPSIS
2024-09-23 01:33:17 +00:00
Checks whether the current user is the setup user.
#>
2024-09-23 01:33:17 +00:00
function Test-SetupUser {
($IsWindows ? $env:UserName : $env:USER) -eq (Get-SetupUser);
2024-08-08 00:28:40 +00:00
}