{"id":3774,"date":"2014-03-28T09:34:04","date_gmt":"2014-03-28T13:34:04","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3774"},"modified":"2014-04-09T08:48:38","modified_gmt":"2014-04-09T12:48:38","slug":"friday-fun-create-all-powershell-profile-scripts","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/","title":{"rendered":"Friday Fun: Create All PowerShell Profile Scripts"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-1688\" alt=\"talkbubble\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png\" width=\"198\" height=\"208\" \/><\/a>Whenever I train on PowerShell I inevitably get around to discussing PowerShell profile scripts. For those of you new to PowerShell, a profile script is where you put all the commands you want to run that will define your PowerShell session just the way you need it. You might load some snapins, create some PSDrives or define some variables. There are actually several profile scripts that can be run, depending on whether you are in the PowerShell console, the PowerShell ISE or some other PowerShell host.<\/p>\n<p>The profile paths are hard-coded. You can see all of them by looking at the built-in $profile variable.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; $profile | select *\r\n\r\nAllUsersAllHosts       : C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\profile.ps1\r\nAllUsersCurrentHost    : C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\Microsoft.PowerShell_profile.ps\r\n                         1\r\nCurrentUserAllHosts    : C:\\Users\\Jeff\\Documents\\WindowsPowerShell\\profile.ps1\r\nCurrentUserCurrentHost : C:\\Users\\Jeff\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1\r\nLength                 : 74<\/pre>\n<p>You can also look at just $profile which will show you the script for the current user on the current host. If you look at this in the ISE you'll see some things are different.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/ISE-Profiles.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/ISE-Profiles-300x46.png\" alt=\"ISE-Profiles\" width=\"300\" height=\"46\" class=\"aligncenter size-medium wp-image-3775\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/ISE-Profiles-300x46.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/ISE-Profiles.png 988w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This variable is a bit tricky. Even though you can see properties here, if you pipe $profile to Get-Member all you get is a string definition. Here's another way you can discover these.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; $profile.psobject.properties | format-table Name,Value -auto\r\n\r\nName                   Value\r\n----                   -----\r\nAllUsersAllHosts       C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\profile.ps1\r\nAllUsersCurrentHost    C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\Microsoft.PowerShell_profile.ps1\r\nCurrentUserAllHosts    C:\\Users\\Jeff\\Documents\\WindowsPowerShell\\profile.ps1\r\nCurrentUserCurrentHost C:\\Users\\Jeff\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1\r\nLength                 74<\/pre>\n<p>Although I don't really care about the length so let's filter it out.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; $profile.psobject.properties | select -first 4 | format-table Name,Value -auto\r\n\r\nName                   Value\r\n----                   -----\r\nAllUsersAllHosts       C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\profile.ps1\r\nAllUsersCurrentHost    C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\Microsoft.PowerShell_profile.ps1\r\nCurrentUserAllHosts    C:\\Users\\Jeff\\Documents\\WindowsPowerShell\\profile.ps1\r\nCurrentUserCurrentHost C:\\Users\\Jeff\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1<\/pre>\n<p>Now for the fun part. That value is a path so I can use Test-Path to see if it exists. If not, I can create the profile and at least indicate that is isn't being used. Because most of these files don't exist by default and in fact the WindowsPowerShell folder doesn't exist under Documents until you create it, you might have to create the parent folder first. So I came up with a little script called Create-AllProfiles.ps1.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 3.0\r\n\r\n[cmdletbinding(SupportsShouldProcess=$True)]\r\nParam()\r\n\r\n$profile.psobject.properties.value[0..3] | where { -Not (Test-path $_)} |\r\nforeach {\r\n  #create the parent folder if it doesn't exist\r\n  $parent = Split-Path $_\r\n  if (-Not (Test-Path -path $parent)) {\r\n    mkdir $parent\r\n   }\r\n\r\n  #create the profile with this text\r\n  #the here string must be left justified\r\n$txt=@\"\r\n#requires -version $($psversiontable.PSVersion)\r\n\r\n&lt;#\r\nThis profile is not used and intentionally left blank.\r\n $env:userdomain\\$env:username\r\n $(Get-Date)\r\n#&gt;\r\n\r\n\"@ \r\n\r\n#write the text to the profile script\r\nWrite-Host \"Creating $_\" -ForegroundColor Green\r\n$txt | Out-File -FilePath $_\r\n\r\n}\r\n<\/pre>\n<p>The script takes advantage of a feature in PowerShell 3 that will automatically enumerate properties. In PowerShell 2.0 I would need to do this:<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; $profile.psobject.properties | select -ExpandProperty Value -first 4\r\nC:\\Windows\\System32\\WindowsPowerShell\\v1.0\\profile.ps1\r\nC:\\Windows\\System32\\WindowsPowerShell\\v1.0\\Microsoft.PowerShell_profile.ps1\r\nC:\\Users\\Jeff\\Documents\\WindowsPowerShell\\profile.ps1\r\nC:\\Users\\Jeff\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1<\/pre>\n<p>But now in v3 and later I can do this:<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; $profile.psobject.properties.value[0..3]\r\nC:\\Windows\\System32\\WindowsPowerShell\\v1.0\\profile.ps1\r\nC:\\Windows\\System32\\WindowsPowerShell\\v1.0\\Microsoft.PowerShell_profile.ps1\r\nC:\\Users\\Jeff\\Documents\\WindowsPowerShell\\profile.ps1\r\nC:\\Users\\Jeff\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1<\/pre>\n<p>The value property would show all of the values, including the length so because I'm getting an array, I can use a range of index numbers to select just the ones I want. In my script each value is tested and those that don't exist are passed on to Foreach-Object. <\/p>\n<p>For each path, I first split it so I can test if the parent path exists. If not, it is created. Then I create some text that will be inserted into each new profile script. The script supports -WhatIf so you can see what it would do before you run it for real.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/create-allprofiles.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/create-allprofiles-300x125.png\" alt=\"create-allprofiles\" width=\"300\" height=\"125\" class=\"aligncenter size-medium wp-image-3777\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/create-allprofiles-300x125.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/create-allprofiles.png 837w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I end up with a profile script that looks like this:<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/create-allprofiles-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/create-allprofiles-2-300x178.png\" alt=\"create-allprofiles-2\" width=\"300\" height=\"178\" class=\"aligncenter size-medium wp-image-3778\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/create-allprofiles-2-300x178.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/03\/create-allprofiles-2.png 637w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Ideally, I would recommend you digitally sign the profile scripts, assuming you are using an AllSigned execution policy, so that no changes can be made to these scripts without your knowledge.  Just don't forget to run this in the PowerShell ISE as well.  If you have profiles already created, they will be ignored.  And should you decide later to take advantage of any of the profile scripts, they are ready for you to edit.<\/p>\n<p>Learn, enjoy and have a great weekend.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whenever I train on PowerShell I inevitably get around to discussing PowerShell profile scripts. For those of you new to PowerShell, a profile script is where you put all the commands you want to run that will define your PowerShell session just the way you need it. You might load some snapins, create some PSDrives&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"NEW! Friday Fun: Create All #PowerShell Profile Scripts http:\/\/wp.me\/p1nF6U-YS","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[534,84,540],"class_list":["post-3774","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-powershell","tag-profile","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun: Create All PowerShell Profile Scripts &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: Create All PowerShell Profile Scripts &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Whenever I train on PowerShell I inevitably get around to discussing PowerShell profile scripts. For those of you new to PowerShell, a profile script is where you put all the commands you want to run that will define your PowerShell session just the way you need it. You might load some snapins, create some PSDrives...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2014-03-28T13:34:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-04-09T12:48:38+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: Create All PowerShell Profile Scripts\",\"datePublished\":\"2014-03-28T13:34:04+00:00\",\"dateModified\":\"2014-04-09T12:48:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/\"},\"wordCount\":508,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/talkbubble.png\",\"keywords\":[\"PowerShell\",\"Profile\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/\",\"name\":\"Friday Fun: Create All PowerShell Profile Scripts &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/talkbubble.png\",\"datePublished\":\"2014-03-28T13:34:04+00:00\",\"dateModified\":\"2014-04-09T12:48:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/#primaryimage\",\"url\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/talkbubble.png\",\"contentUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/talkbubble.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3774\\\/friday-fun-create-all-powershell-profile-scripts\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: Create All PowerShell Profile Scripts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Friday Fun: Create All PowerShell Profile Scripts &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: Create All PowerShell Profile Scripts &#8226; The Lonely Administrator","og_description":"Whenever I train on PowerShell I inevitably get around to discussing PowerShell profile scripts. For those of you new to PowerShell, a profile script is where you put all the commands you want to run that will define your PowerShell session just the way you need it. You might load some snapins, create some PSDrives...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/","og_site_name":"The Lonely Administrator","article_published_time":"2014-03-28T13:34:04+00:00","article_modified_time":"2014-04-09T12:48:38+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: Create All PowerShell Profile Scripts","datePublished":"2014-03-28T13:34:04+00:00","dateModified":"2014-04-09T12:48:38+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/"},"wordCount":508,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png","keywords":["PowerShell","Profile","Scripting"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/","name":"Friday Fun: Create All PowerShell Profile Scripts &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png","datePublished":"2014-03-28T13:34:04+00:00","dateModified":"2014-04-09T12:48:38+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/#primaryimage","url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png","contentUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3774\/friday-fun-create-all-powershell-profile-scripts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: Create All PowerShell Profile Scripts"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":5073,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5073\/powershell-sessions-and-vs-code\/","url_meta":{"origin":3774,"position":0},"title":"PowerShell Sessions and VS Code","author":"Jeffery Hicks","date":"June 8, 2016","format":false,"excerpt":"If you do any amount of PowerShell scripting you have most likely heard about Visual Studio Code. This is a free cross-platform light-weight editor from Microsoft. VS Code supports multiple languages and is extensible. I've tried different versions since it was first released but never found a reason to jump\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-5.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-5.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-5.png?resize=525%2C300 1.5x"},"classes":[]},{"id":7908,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7908\/measuring-powershell-profile-performance\/","url_meta":{"origin":3774,"position":1},"title":"Measuring PowerShell Profile Performance","author":"Jeffery Hicks","date":"November 25, 2020","format":false,"excerpt":"Today's topic is one of those things that I don't know why I've never addressed before. Well, I have for myself in a manual process. Hopefully you'll find it useful. As you probably know, PowerShell uses a set of profile scripts. These scripts have hard-coded paths and PowerShell runs them\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/ps7profiles.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/ps7profiles.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/ps7profiles.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/ps7profiles.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/ps7profiles.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/ps7profiles.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":5626,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5626\/throwing-the-kitchen-sink-at-powershell\/","url_meta":{"origin":3774,"position":2},"title":"Throwing the Kitchen Sink at PowerShell","author":"Jeffery Hicks","date":"August 22, 2017","format":false,"excerpt":"The other day I was watching a good intro video from Shane Young on getting started with PowerShell profiles. I use profile scripts extensively, and they can be extremely useful in configuring your PowerShell experience. One element you could add to your profile is a customized PowerShell prompt. Microsoft provides\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"everythingprompt1","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/08\/everythingprompt1_thumb.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/08\/everythingprompt1_thumb.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/08\/everythingprompt1_thumb.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/08\/everythingprompt1_thumb.png?resize=700%2C400 2x"},"classes":[]},{"id":6371,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6371\/making-the-leap-to-powershell-core\/","url_meta":{"origin":3774,"position":3},"title":"Making the Leap to PowerShell Core","author":"Jeffery Hicks","date":"January 9, 2019","format":false,"excerpt":"For years I have spent most of my time in a Windows PowerShell prompt. I have actually taken it as a badge of honor that I've been able to manage my day and all of my work from a PowerShell prompt. I also have created practically all of my content\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-11.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-11.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-11.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-11.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":555,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/","url_meta":{"origin":3774,"position":4},"title":"Profiling a Script","author":"Jeffery Hicks","date":"January 14, 2010","format":false,"excerpt":"Last summer, Ed Wilson was looking for help with a small part of the book he was finishing up, Windows PowerShell 2.0 Best Practices. The topic he was working on was, \u201cHow do I know this script is safe to run?\u201d Which is a great question and one with greater\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2486,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2486\/powershell-version-profile-tips\/","url_meta":{"origin":3774,"position":5},"title":"PowerShell Version Profile Tips","author":"Jeffery Hicks","date":"September 12, 2012","format":false,"excerpt":"Now that PowerShell v3 is finally and officially with us, I'm trusting that many of you are embracing it. I've made the jump, although I have had to make some minor adjustments. If you are going to live entirely in a PowerShell v3 world, fantastic! Go forth and spread the\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/05\/talkbubble-v3-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=3774"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3774\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}