Getting started with PowerShell Profiles

Sdílet
Vložit
  • čas přidán 11. 09. 2024

Komentáře • 64

  • @natestrings673
    @natestrings673 Před 2 lety +2

    5 years later. Still relevant and awesome. Thanks Shane!

    • @ShanesCows
      @ShanesCows  Před 2 lety

      Thanks Nate! Never would have guessed these videos would live so long but they have. A statement to the live of PowerShell. :)

  • @academyministorage6397
    @academyministorage6397 Před 2 lety +1

    Your videos are definitely the most digestible for learning some of the fundamentals necessary to think in the context of code. A lot of the courses on CZcams tend to easily overlook that context of thought comes before content of thought.

    • @ShanesCows
      @ShanesCows  Před 2 lety

      Glad you like them! Thanks for the kind words.

    • @academyministorage6397
      @academyministorage6397 Před 2 lety

      @@ShanesCows My apologies, but I had a question: I've been adding a number of scripts that I've found to my $profile text file and thought it made sense to add Update-Help as an initial command to make sure everything's up-to-date- right? It seems to run fine, but it returns with an error. I didn't look "too" far into Google, but there didn't seem to be a clear reason why until it struck me that since I've only installed the Azure module and mayyybe NuGet, it probably was returning errors for not being able to update certain other modules because I didn't have them installed to be found in any directory (What I assume "HelpInfoUri property" is referring to..). Question is, what (IF/Else?) would I add to the Update-Help command to specify only updating help for the modules I do have installed on the system?.. I'm still at level 0, so if my Kung Fu question doesn't even make sense, let me know Ci Fu. Thanks!

  • @scottlee544
    @scottlee544 Před 7 lety +3

    I love your PS lessons ,very helpful. I come from Taiwan , Thanks Shane

  • @jas7658
    @jas7658 Před 7 lety +1

    Your video just came in on time. This helps me a lot. It is funny, both my Online Instructor and an over $150 textbook have poor lessons about a PowerShell Profile. Thanks for making this video.

  • @30void33
    @30void33 Před 3 lety +1

    Ahhh dubstep intros from 2017, One thing I do not miss. love the vid though!

    • @ShanesCows
      @ShanesCows  Před 3 lety

      😹 That video feels like a million years ago.

  • @MatrixTek
    @MatrixTek Před 7 lety +1

    Thanks Shane, This is great stuff! I would love to have a full transcript.

  • @YahyaArbab
    @YahyaArbab Před rokem +1

    This video feels 20 years old with that style of speaking and editing, even though it is only 5.

    • @ShanesCows
      @ShanesCows  Před rokem

      Yeah, my videos have come a LONG way in the last 5 years. I look back at some of the old ones and just shake my head. 🤣

  • @BezKomentare
    @BezKomentare Před 6 lety +1

    I have watched all your videos and they helped me a lot!! Thanks

    • @ShanesCows
      @ShanesCows  Před 6 lety +1

      Thank you for the note. :) That is what keeps me going. Love the dog also. :)

  • @NancyRileyNuniverse
    @NancyRileyNuniverse Před 6 lety +1

    I love your PS videos, keep them coming👌

  • @riverwindbonsai
    @riverwindbonsai Před 7 lety +1

    Very helpful, thanks!

  • @carrt7
    @carrt7 Před 5 lety +2

    Keen to set up a profile, but (on work PC HP8560p Windows 10 PowerShell ISE),
    fails, with error message
    New-Item : Could not find a part of the path 'C:\Users\Administrator.WHOMEHD009\Docume
    nts\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1'.
    At line:1 char:1
    Any ideas?

    • @ShanesCows
      @ShanesCows  Před 5 lety

      No. Sorry. Maybe try creating it in a different path?

    • @billywashington8785
      @billywashington8785 Před 4 lety +1

      I also ran into this recently! Not sure if u still want to know the fix, but if u do, try this:
      New-Item -path $PROFILE -ItemType File -Force

    • @alekseev74
      @alekseev74 Před 4 lety

      @@billywashington8785 Thanks!

  • @djbprogrammer
    @djbprogrammer Před 7 lety +1

    Love your presentations...thank you!

  • @rashmitapriyadarsini8073
    @rashmitapriyadarsini8073 Před 3 lety +1

    Thanks Shane, are you able to guide how to import functions to the profile script.

  • @biduino07
    @biduino07 Před 4 lety +1

    Excelente vídeo!!

  • @erikschiegg68
    @erikschiegg68 Před 4 lety +1

    Nice, but as I'm Iron Man 2.0, I need some cool ASCII art showing when opening the terminal. I made a nice batch file and would like to know
    -where do I have to store "terminal.bat"
    -how do I include the bat in $PROFILE

    • @ShanesCows
      @ShanesCows  Před 4 lety

      Sorry been a long time since I messed with profiles

    • @erikschiegg68
      @erikschiegg68 Před 4 lety

      @@ShanesCows Had to give Powershell the permission to execute the bat in the profile, works now. Have a nice time.

  • @babaijebu6462
    @babaijebu6462 Před 7 lety +1

    Awesome

  • @SylvStone
    @SylvStone Před 2 lety +1

    good lesson but I got into security execution policies when I (re)open PowerShell, the profile file fails to load

    • @ShanesCows
      @ShanesCows  Před 2 lety

      YOu can have the profile set the excution policy I think. Not sure, I haven't ran into that.

    • @SylvStone
      @SylvStone Před 2 lety

      @@ShanesCows yep (as my profile is basically about the editing mode (The Emacs keyboard shortcuts) first I tried by creating a $Profile.CurrentUserAllHosts, then)) set out the execution policy to unrestricted, now it works

  • @dazecm
    @dazecm Před 3 lety +1

    Great content. My PowerShell profiles on my laptop and desktop both point to one .ps1 file that's stored on OneDrive and I'd like to disable this so profiles on my laptop and desktop are separate. How do I do this?

    • @ShanesCows
      @ShanesCows  Před 3 lety

      .... I don't know. I haven't done that one before. 😐

    • @dazecm
      @dazecm Před 3 lety

      @@ShanesCows I eventually settled on the .ps1 file on my OneDrive containing just this line:
      . $profile.AllUsersAllHosts

  • @arig2519
    @arig2519 Před 6 lety +1

    How did you get the "Get_PSReadLineOption"? I am seeing "ObjectNotFound". I am using Powershell 2.0.

    • @arig2519
      @arig2519 Před 6 lety

      Also, if you could tell me little about the two commandlets: test-path & New-Item

    • @ShanesCows
      @ShanesCows  Před 6 lety

      Check out this video to upgrade your PowerShell. Update PowerShell for Windows 7 and Windows 8 with PSReadLine and WMF 5.1 czcams.com/video/3jAH92mBbRk/video.html

  • @ahmedatef221
    @ahmedatef221 Před 2 lety

    what is the meaning by host?

  • @bobdillon7254
    @bobdillon7254 Před 7 lety +1

    How about something like a roaming profile for PowerShell, that follows you around from machine to machine? Can you point the profile to a NAS location? (Hope you didn't mention that and I missed it).

    • @ShanesCows
      @ShanesCows  Před 7 lety +1

      I haven't tried any of that fun. I should.

    • @JefferyHicks
      @JefferyHicks Před 7 lety

      The profile paths are hard-coded. But you can dot source or load commands from anywhere, even a UNC path. In the profile script Shane shows, you could have a single command like this:
      . \\NAS01\Files\MyRealProfile.ps1

  • @jaque41111
    @jaque41111 Před 5 lety +1

    Hi just started using your videos to learn PowerShell. Which are great bye the way 😁.
    I do everything the same but when I get to 6:34 In the vid I get error message which is too long to write on here but goes
    +CategoryInfo:Invalid argument.
    +fullyquailified error id:positional parameter not found.
    Any help would b appreciate.
    Thx

    • @ShanesCows
      @ShanesCows  Před 5 lety

      Can you paste your PowerShell Line here? Maybe I can help

    • @jaque41111
      @jaque41111 Před 5 lety +1

      @@ShanesCows the for replying it was because the actual PowerShell folder in documents was missing. But when I updated PowerShell it came back so all good now ...keep the vids coming I'm learning quite a lot for a newbie .

    • @ShanesCows
      @ShanesCows  Před 5 lety

      Awesome

  • @krishnachoudhary4924
    @krishnachoudhary4924 Před 6 lety +1

    Can you please make video on PS functions??????

    • @ShanesCows
      @ShanesCows  Před 6 lety

      I need to but never got there. It is on the list.

  • @manojkumar-iu9en
    @manojkumar-iu9en Před 7 lety

    could you please tell me from where you copied code or please paste here for poiwershell profile so that i could use

    • @ShanesCows
      @ShanesCows  Před 7 lety

      Everything is in the description above.

  • @JefferyHicks
    @JefferyHicks Před 7 lety

    You're killing me with Notepad.

    • @bobdillon7254
      @bobdillon7254 Před 7 lety +1

      I've mentioned vsCode to him a few times...

    • @Rood67
      @Rood67 Před 7 lety

      Jeffery Hicks for all points and purposes, Shane's Is making PowerShell For Dummies without calling it that. Everyone has notepad if they have a Windows computer.

    • @Rood67
      @Rood67 Před 7 lety

      Bob Dillon not everyone is eager to jump on the vscode train. Personally, it may be 0.000163 percent more efficient than the available PowerShell ISE. I just don't like the way it looks, and the interface is what I see. So, internal efficiency isn't worth it in the end.

    • @bobdillon7254
      @bobdillon7254 Před 7 lety

      Completely understand what you're saying. For me, I can't stand ISE. Never felt comfortable using it, so I've always used something else (NotePad ++, TextPad, etc). vsCode seems to be the first editor from Microsoft that, for me, I really enjoy using. And, from what I hear, it will replace ISE in PowerShell.Next. If you don't like the way it looks, may I recommend that you try one of the many add-ins to change the look and feel?

  • @kimran8830
    @kimran8830 Před 7 lety +1

    Hi shane young i am looking on trainig video from your end
    On PS special characters like $ is used for Variable declaration like that
    {},|,%,.,::,..,!,?,'() when and how to use this special characters in PS Scripting

    • @ShanesCows
      @ShanesCows  Před 7 lety +1

      Not a bad idea for a video. Have you watched my other videos? They cover a lot of that stuff. Start with Learn PowerShell and go from there.

    • @kimran8830
      @kimran8830 Před 7 lety

      Shane Young OK,i will try to refer those videos.if not find i will get back to you

  • @RufusVidS
    @RufusVidS Před 3 lety +1

    Bummer! PSReadLineOption is completely different in Win10.

    • @ShanesCows
      @ShanesCows  Před 3 lety

      Hmmm. I didn’t realize it was so different. 😑🤔

    • @RufusVidS
      @RufusVidS Před 3 lety

      @@ShanesCows the color handling has changed significantly.

  • @paulwelsby7823
    @paulwelsby7823 Před 4 lety +1

    my name is paul welsby i have the solution for you and with this one there is 2 ways of doing this one.
    1 $host.ui.rawui.foregroundcolor = "yellow" and $host.ui.rawui.backgroundcolor = "black"
    2 $host.privatedata.errorforegroundcolor = "yellow" $host.privatedataerrorbackgroundcolor = "black"
    3 [console]::foregroundcolor = "yellow"
    [console]::backgroundcolor = "black"

  • @aaacougarselfstorage794

    I'm trying to use the If Admin line to adjust the colors of the console based on which of a few buttons a user selects from, but when my Get-PSReadLineOption returns different values than show here...
    "EditMode : Windows
    AddToHistoryHandler :
    HistoryNoDuplicates : True
    HistorySavePath : C:\Users\couga\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\Console
    Host_history.txt
    HistorySaveStyle : SaveIncrementally
    HistorySearchCaseSensitive : False
    HistorySearchCursorMovesToEnd : False
    MaximumHistoryCount : 4096
    ContinuationPrompt : >>
    ExtraPromptLineCount : 0
    PromptText : >
    BellStyle : Audible
    DingDuration : 50
    DingTone : 1221
    CommandsToValidateScriptBlockArguments : {ForEach-Object, %, Invoke-Command, icm...}
    CommandValidationHandler :
    CompletionQueryItems : 100
    MaximumKillRingCount : 10
    ShowToolTips : True
    ViModeIndicator : None
    WordDelimiters : ;:,.[]{}()/\|^&*-=+'"--―
    CommandColor : "$([char]0x1b)[93m"
    CommentColor : "$([char]0x1b)[32m"
    ContinuationPromptColor : "$([char]0x1b)[33m"
    DefaultTokenColor : "$([char]0x1b)[33m"
    EmphasisColor : "$([char]0x1b)[96m"
    ErrorColor : "$([char]0x1b)[91m"
    KeywordColor : "$([char]0x1b)[92m"
    MemberColor : "$([char]0x1b)[97m"
    NumberColor : "$([char]0x1b)[97m"
    OperatorColor : "$([char]0x1b)[90m"
    ParameterColor : "$([char]0x1b)[90m"
    SelectionColor : "$([char]0x1b)[35;43m"
    StringColor : "$([char]0x1b)[36m"
    TypeColor : "$([char]0x1b)[37m"
    VariableColor : "$([char]0x1b)[92m""
    Is this just a difference between OS versions (found out today that I can't download Windows 11 'cause the processor sucks- verbatim) or did I break it?