Question

Just a quick on this morning.

Is it possible to create a file and store in it the Powershell runspace/session memory?

Something like:

out-file 'powershell session space'?

instead of:

out-file C:\temp\system_info.txt

I'm creating an e-mail template that catches data from the machine the script is run on and sends it to the domain admin. However if it's run by another user who for whatever reason hasn't got access to the 'temp' folder or even the C:\ drive, I want the file (script_info.txt) to be created in the memory of the PS session. Is that possible?

Thanks

Was it helpful?

Solution

Found out it was this:

out-file "$env:TEMP\file.extention"

OTHER TIPS

Surely the user has write access to somewhere on the local drive.

Your other option may be Memory-Mapped Files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top