vulcast-vertical/.github/scripts/utils.pwsh/Ensure-Location.ps1
Vulcast c5b35d8ec8
Some checks are pending
Build Windows DLL / Build for Windows (push) Waiting to run
Add CI build infrastructure from OBS plugin template
Added GitHub Actions workflow and build scripts from
obsproject/obs-plugintemplate for Windows DLL builds.

Push to GitHub and go to Actions tab to build the DLL.
2026-06-29 23:08:27 +01:00

29 lines
716 B
PowerShell

function Ensure-Location {
<#
.SYNOPSIS
Ensures current location to be set to specified directory.
.DESCRIPTION
If specified directory exists, switch to it. Otherwise create it,
then switch.
.EXAMPLE
Ensure-Location "My-Directory"
Ensure-Location -Path "Path-To-My-Directory"
#>
param(
[Parameter(Mandatory)]
[string] $Path
)
if ( ! ( Test-Path $Path ) ) {
$_Params = @{
ItemType = "Directory"
Path = ${Path}
ErrorAction = "SilentlyContinue"
}
New-Item @_Params | Set-Location
} else {
Set-Location -Path ${Path}
}
}