mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
17 lines
388 B
PowerShell
17 lines
388 B
PowerShell
|
|
function New-IcingaTemporaryFile()
|
||
|
|
{
|
||
|
|
[string]$TmpFile = '';
|
||
|
|
[string]$FilePath = '';
|
||
|
|
|
||
|
|
while ($TRUE) {
|
||
|
|
$TmpFile = [string]::Format('tmp_icinga{0}.tmp', (Get-Random));
|
||
|
|
$FilePath = Join-Path $Env:TMP -ChildPath $TmpFile;
|
||
|
|
|
||
|
|
if ((Test-Path $FilePath) -eq $FALSE) {
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return (New-Item -Path $FilePath -ItemType File);
|
||
|
|
}
|