{"id":9001,"date":"2006-12-28T11:33:00","date_gmt":"2006-12-28T11:33:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2006\/12\/28\/editing-your-profile-file\/"},"modified":"2019-02-18T13:21:00","modified_gmt":"2019-02-18T20:21:00","slug":"editing-your-profile-file","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/editing-your-profile-file\/","title":{"rendered":"Editing your Profile file"},"content":{"rendered":"<p><!--\n \/* Font Definitions *\/\n @font-face\n\t{font-family:\"Cambria Math\";\n\tpanose-1:2 4 5 3 5 4 6 3 2 4;}\n@font-face\n\t{font-family:Cambria;\n\tpanose-1:2 4 5 3 5 4 6 3 2 4;}\n@font-face\n\t{font-family:Calibri;\n\tpanose-1:2 15 5 2 2 2 4 3 2 4;}\n@font-face\n\t{font-family:\"Lucida Console\";\n\tpanose-1:2 11 6 9 4 5 4 2 2 4;}\n \/* Style Definitions *\/\n p.MsoNormal, li.MsoNormal, div.MsoNormal\n\t{margin-top:0in;\n\tmargin-right:0in;\n\tmargin-bottom:10.0pt;\n\tmargin-left:.75in;\n\tline-height:115%;\n\tfont-size:11.0pt;\n\tfont-family:\"Calibri\",\"sans-serif\";}\nh2\n\t{mso-style-link:\"Heading 2 Char\";\n\tmargin-top:10.0pt;\n\tmargin-right:0in;\n\tmargin-bottom:0in;\n\tmargin-left:.75in;\n\tmargin-bottom:.0001pt;\n\tline-height:115%;\n\tpage-break-after:avoid;\n\tfont-size:13.0pt;\n\tfont-family:\"Cambria\",\"serif\";\n\tcolor:#4F81BD;\n\tfont-weight:bold;}\na:link, span.MsoHyperlink\n\t{color:blue;\n\ttext-decoration:underline;}\na:visited, span.MsoHyperlinkFollowed\n\t{color:purple;\n\ttext-decoration:underline;}\np\n\t{margin-right:0in;\n\tmargin-left:0in;\n\tfont-size:12.0pt;\n\tfont-family:\"Times New Roman\",\"serif\";}\np.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph\n\t{margin-top:0in;\n\tmargin-right:0in;\n\tmargin-bottom:10.0pt;\n\tmargin-left:.5in;\n\tline-height:115%;\n\tfont-size:11.0pt;\n\tfont-family:\"Calibri\",\"sans-serif\";}\nspan.Heading2Char\n\t{mso-style-name:\"Heading 2 Char\";\n\tmso-style-link:\"Heading 2\";\n\tfont-family:\"Cambria\",\"serif\";\n\tcolor:#4F81BD;\n\tfont-weight:bold;}\np.msolistparagraphcxspfirst, li.msolistparagraphcxspfirst, div.msolistparagraphcxspfirst\n\t{mso-style-name:msolistparagraphcxspfirst;\n\tmargin-top:0in;\n\tmargin-right:0in;\n\tmargin-bottom:0in;\n\tmargin-left:.5in;\n\tmargin-bottom:.0001pt;\n\tline-height:115%;\n\tfont-size:11.0pt;\n\tfont-family:\"Calibri\",\"sans-serif\";}\np.msolistparagraphcxspmiddle, li.msolistparagraphcxspmiddle, div.msolistparagraphcxspmiddle\n\t{mso-style-name:msolistparagraphcxspmiddle;\n\tmargin-top:0in;\n\tmargin-right:0in;\n\tmargin-bottom:0in;\n\tmargin-left:.5in;\n\tmargin-bottom:.0001pt;\n\tline-height:115%;\n\tfont-size:11.0pt;\n\tfont-family:\"Calibri\",\"sans-serif\";}\np.msolistparagraphcxsplast, li.msolistparagraphcxsplast, div.msolistparagraphcxsplast\n\t{mso-style-name:msolistparagraphcxsplast;\n\tmargin-top:0in;\n\tmargin-right:0in;\n\tmargin-bottom:10.0pt;\n\tmargin-left:.5in;\n\tline-height:115%;\n\tfont-size:11.0pt;\n\tfont-family:\"Calibri\",\"sans-serif\";}\nspan.CodeChar\n\t{mso-style-name:\"Code Char\";\n\tmso-style-link:Code;\n\tfont-family:\"Lucida Console\";\n\tcolor:#EEEDF0;\n\tbackground:#012456;}\np.Code, li.Code, div.Code\n\t{mso-style-name:Code;\n\tmso-style-link:\"Code Char\";\n\tmargin-top:0in;\n\tmargin-right:0in;\n\tmargin-bottom:12.0pt;\n\tmargin-left:.75in;\n\tline-height:115%;\n\tbackground:#012456;\n\tfont-size:8.0pt;\n\tfont-family:\"Lucida Console\";\n\tcolor:#EEEDF0;}\np.msopapdefault, li.msopapdefault, div.msopapdefault\n\t{mso-style-name:msopapdefault;\n\tmargin-top:0in;\n\tmargin-right:0in;\n\tmargin-bottom:10.0pt;\n\tmargin-left:.75in;\n\tline-height:115%;\n\tfont-size:12.0pt;\n\tfont-family:\"Times New Roman\",\"serif\";}\n.MsoChpDefault\n\t{font-size:10.0pt;}\n@page Section1\n\t{size:8.5in 11.0in;\n\tmargin:1.0in 1.0in 1.0in 1.0in;}\ndiv.Section1\n\t{page:Section1;}\n--><\/p>\n<p>$hay has a new scripting blog at <a href=\"http:\/\/scriptolog.blogspot.com\/\">http:\/\/scriptolog.blogspot.com\/<\/a>&nbsp;.&nbsp; His first blog entry <a href=\"http:\/\/scriptolog.blogspot.com\/2006\/12\/restart-your-engins-powershell-way_28.html\">Restart your engine &#8211; The PowerShell Way<\/a>, talks about how he frequently edits his PowerShell profile file and then restarts his session.&nbsp; In his directions he says:<\/p>\n<p>2: type: Notepad $profile to open your profile file<\/p>\n<p>I looked at this and thought about my <a href=\"http:\/\/blogs.msdn.com\/powershell\/archive\/2006\/12\/25\/philosophy-of-automation.aspx\">Philosophy of Automation<\/a> post and thought, if you are editing your profile a lot, you ought to automate that.&nbsp; I quickly typed Notepad $Profile and added the following to the end of my profile file<\/p>\n<p>function Edit-ProfileFile{<br \/>&nbsp;&nbsp; Notepad $profile<br \/>}<br \/>Set-Alias epf Edit-ProfileFile<\/p>\n<p>&nbsp;At that point I asked myself, &#8220;hmm is &#8216;E&#8217; the right alias shorthand for &#8216;EDIT'&#8221;.&nbsp; So I did the following to find out:<\/p>\n<p class=\"Code\">PS&gt; gal e*<br \/>CommandType&nbsp;&nbsp;&nbsp;&nbsp; Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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&nbsp;&nbsp; eghp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edit-GlobalHostProfile<br \/>Alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ep&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edit-Profile<br \/>Alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ehp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edit-HostProfile<br \/>Alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; efun&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edit-Function<\/p>\n<p>So first, &#8220;E&#8221; is the right shorthand for &#8220;EDIT&#8221; but then&nbsp;I already had an &#8220;Edit-Profile&#8221; which was aliased to EP (not EPF).&nbsp; Upon investigation, these were already provided to me when installed the <a href=\"http:\/\/www.codeplex.com\/Wiki\/View.aspx?ProjectName=PowerShellCX\">PowerShell Community Extensions<\/a> (PSCX).&nbsp; <\/p>\n<p>So the bottom lines are:<\/p>\n<p>1) $hay is right, you should edit your profile file often to save the automation that you figure out.<br \/>2) Use the Philosophy of Automation model so that you just type &#8220;ep&#8221; instead of&nbsp; &#8220;notepad $profile&#8221;.<br \/>3) Download and learn the PowerShell Community Extensions so that you can stand on the shoulders of giants.<\/p>\n<p>Cheers!<\/p>\n<p>Jeffrey Snover [MSFT]<br \/>Windows PowerShell\/MMC Architect<br \/>Visit the Windows PowerShell Team blog at:&nbsp;&nbsp;&nbsp; <a href=\"http:\/\/blogs.msdn.com\/PowerShell\">http:\/\/blogs.msdn.com\/PowerShell<\/a><br \/>Visit the Windows PowerShell ScriptCenter at:&nbsp; <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx\">http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>$hay has a new scripting blog at http:\/\/scriptolog.blogspot.com\/&nbsp;.&nbsp; His first blog entry Restart your engine &#8211; The PowerShell Way, talks about how he frequently edits his PowerShell profile file and then restarts his session.&nbsp; In his directions he says: 2: type: Notepad $profile to open your profile file I looked at this and thought about [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[29,11],"class_list":["post-9001","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-environment","tag-philosophy"],"acf":[],"blog_post_summary":"<p>$hay has a new scripting blog at http:\/\/scriptolog.blogspot.com\/&nbsp;.&nbsp; His first blog entry Restart your engine &#8211; The PowerShell Way, talks about how he frequently edits his PowerShell profile file and then restarts his session.&nbsp; In his directions he says: 2: type: Notepad $profile to open your profile file I looked at this and thought about [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/9001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=9001"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/9001\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=9001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=9001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=9001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}