I have a PS Script that needs to create a temp file to work properly.

Does anyone know a temp location the task engine uses?  One i can hard code into my script?

Here is my script for reference

$CDRom_Present = Get-WMIObject -Class Win32_LogicalDisk | Where-Object {$_.DriveType -eq5}
NEW-ITEM -Path x:\KACE\engine\boot.txt -ItemType file -force | OUT-NULL
if($CDRom_Present-eq $null)
{
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “SELECT DISK 0”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “CLEAN”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “CREATE PARTITION PRIMARY”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “SELECT VOLUME 0”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “ASSIGN LETTER=C”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “FORMAT QUICK FS=NTFS”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -value “ACTIVE”
}
else 
{
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “SELECT DISK 0”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “CLEAN”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “CREATE PARTITION PRIMARY”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “SELECT VOLUME 1”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “ASSIGN LETTER=C”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -Value “FORMAT QUICK FS=NTFS”
ADD-CONTENT -Path x:\KACE\engine\boot.txt -value “ACTIVE”
}

DISKPART /S x:\KACE\engine\boot.txt


0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0
If the K2000 is in the KBE then there is t: drive (\\ikbox\petemp) that data can be stored on a temporary basis.
Answered 08/12/2016 by: TheAustinDave
Third Degree Blue Belt

  • So the t: is per machine that has booted? Say if i have 2 machines imaging at the same time, they each have their own t:?
    • The T: (\\ikbox\petemp) is always there and part of the samba share of the K2000. So if two machines are imaging at the same time they both have access to the same /petemp samba share. If you need you could always store something on the X: drive (ram disk but goes away when system reboots to run and configure windows).

      Could just save it to the \petemp directory under the MAC address ID then when needed copy it to anywhere on the C drive you like- then delete the one on /petemp.
      • Ok. So i could store a couple of files out on the share permanently to reference in a script?

        When i browse to the share i don't see a petemp directory. Where on the share do i store them, and how would i call them in the script, ie: x:\, t:\?
Please log in to comment
0
The folder is a hidden folder, but once you have accessed the samba share at \\K2IPAddress and log in just add \petemp to the address. Keep in mind this is a temp directory and during an upgrade/update to the appliance items there may be cleared so I would recommend keeping a 'safe' copy somewhere as well for a back-up.
https://support.software.dell.com/k2000-systems-deployment-appliance/kb/132549
Answered 08/15/2016 by: TheAustinDave
Third Degree Blue Belt

Please log in to comment
Answer this question or Comment on this question for clarity