added 2 new funcs for getting temp files

This commit is contained in:
2023-10-05 14:22:37 -04:00
parent 5cd4e99465
commit 0499a143ef
+6
View File
@@ -269,6 +269,12 @@ Function IsWindowsBuild {
# Get the path to the TEMP folder (context dependent) # Get the path to the TEMP folder (context dependent)
Function Get-TempPath { Return [System.IO.Path]::GetTempPath() } 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 # Determine if the system is 64-bit or not
Function Is64bit { Function Is64bit {
switch ( $(Get-CimInstance -ClassName Win32_OperatingSystem -Property OSArchitecture | Select-Object -ExpandProperty OSArchitecture) ) switch ( $(Get-CimInstance -ClassName Win32_OperatingSystem -Property OSArchitecture | Select-Object -ExpandProperty OSArchitecture) )