Powershell $profile

Welcome Forums General PowerShell Q&A Powershell $profile

Viewing 6 reply threads
  • Author
    Posts
    • #220302
      Participant
      Topics: 30
      Replies: 102
      Points: 505
      Rank: Major Contributor

      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
      \\our.network.tgcsnet.com\tgcsnetdfs\HomeDirectories\proxyadmin\Documents\WindowsPowerShell\Microsoft.PowerShell_profil
      e.ps1?
      [D] Do not run [R] Run once 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

      Tom

    • #220311
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      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.

    • #220401
      Participant
      Topics: 30
      Replies: 102
      Points: 505
      Rank: Major Contributor

      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

    • #220428
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      Do you use roaming profiles folder redirection in your environment?

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

    • #220461
      Participant
      Topics: 30
      Replies: 102
      Points: 505
      Rank: Major Contributor

      Olaf

      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?

    • #220467
      Participant
      Topics: 30
      Replies: 102
      Points: 505
      Rank: Major Contributor

      Olaf

      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

      Tom

      this can be marked a resolved.

    • #220473
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      Which message do you mean?

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

Viewing 6 reply threads
  • You must be logged in to reply to this topic.