Powershell $profile

I created a $profile for my servers.

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run
[D] Do not run [R] Run once [S] Suspend [?] Help (default is “D”):

I type an “R” and it continues.

This all of a sudden started before it ran to completion

Any ideas?

Thank you


The path looks like a path from a share!? Usually a profile is saved on the computer on one of the locations you get when you run

$profile | Select-Object *

You may read this to understand how it works: Understanding the Six PowerShell Profiles.

Thanks OLAF

How can I change it to point to my local users folder?

I ran this command

PS C:\util> new-item $PROFILE.CurrentUserAllHosts -ItemType file -Force

Directory: \\our.network.tgcsnet.com\tgcsnetdfs\HomeDirectories\proxyadmin\Documents\WindowsPowerShell

Mode LastWriteTime Length Name

-a---- 4/18/2020 11:23 PM 0 profile.ps1

It keeps placing it on a network share.

Any ideas?

Thanks Tom

Do you use roaming profiles folder redirection in your environment?

Did you actually try the suggestion in the message you’ve got?


No roaming profiles are used here.

Which message do you mean?

how can I delete the $profile and start over? or how do I change it to a local path?


I figured it out.

On my Documents settings in explorer I had the location the network path I changed it to c:\users\username

Then I was able to recreate the $profile and now it works with out error.

Thank you for your help


this can be marked a resolved.

I meant the warning message you’ve posted in your initial question. Quite often the solution comes with the error message. :wink: