From 0499a143ef5500c9f17363f8f5d61994c174be35 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Thu, 5 Oct 2023 14:22:37 -0400 Subject: [PATCH] added 2 new funcs for getting temp files --- Tools.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tools.ps1 b/Tools.ps1 index b14bd6f..bd8d9f9 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -269,6 +269,12 @@ Function IsWindowsBuild { # Get the path to the TEMP folder (context dependent) Function Get-TempPath { Return [System.IO.Path]::GetTempPath() } +# Get a random file name with random extension +Function Get-RandomFile { Return [System.IO.Path]::GetRandomFileName() } + +# Get a random temp file in the current TEMP folder +Function Get-RandomTempFile { Return [System.IO.Path]::Combine($(Get-TempPath), $(Get-RandomFile)) } + # Determine if the system is 64-bit or not Function Is64bit { switch ( $(Get-CimInstance -ClassName Win32_OperatingSystem -Property OSArchitecture | Select-Object -ExpandProperty OSArchitecture) )