Default Path location differences between Powershell 7.2 and Powershell 5.1 environments

Jesus Chao 141 Reputation points
2024-06-10T15:17:17.3333333+00:00

Hi,

I am in the process of moving our runbooks to use a PowerShell 7.2 environment and in the process of that migration we noticed that the default path for the runbooks are different when running on the Hybrid Worker. Can anyone tell me why the change and if perhaps there is a fix? In PS5.1, the default location is the temporary sandbox location on the hybrid worker, however, in PS7.2, the default location is the HybridWorkerAgent location in the packages location.

This presents an issue for us because we have coded some of our runbooks to leverage the temporary Sandbox location to create CSV files and then send out those files. Once the runbook completes, there is a process that cleans out the temp sandbox directory. Now that 7.2 uses the Packages location, I've noticed that there is no cleanup of those files and now some of my runbooks are picking up old CSV files in the directory.

See the below screen shots for the differences in the default path locations that I am seeing....

PS7.2

HybridWorkerDefaultPath7

PS5.1

HybridWorkerDefaultPath5

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,173 questions
0 comments No comments
{count} votes