{"id":8572,"date":"2021-09-22T13:42:19","date_gmt":"2021-09-22T17:42:19","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=8572"},"modified":"2021-09-22T13:42:23","modified_gmt":"2021-09-22T17:42:23","slug":"fun-with-mapping-powershell-drives","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/","title":{"rendered":"Fun with Mapping PowerShell Drives"},"content":{"rendered":"\n<p>Because I spend my day working from a PowerShell prompt, I rely heavily on PSDrives to quickly access files and folders. And because I am mobile, I might be working at my desk in my home office, or I might be on the road with my trusty Thinkpad. Of course, this means, I want an easy way to provide a seamless experience in either situation. I thought I'd share my solution as well as some other fun I've been having with PSDrives.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Drive Data<\/h2>\n\n\n\n<p>As you might imagine I'm going to use a PowerShell script to handle my drive mapping. Using OneDrive, I synchronize my scripts folder between all machines I might be using. This means I only have to manage the file in one location. I start with data. You can use whatever format you'd like. I'm using CSV because it is simple and my drive mapping data is flat.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">#add some psdrives from this CSV data\n$drivedata = @\"\n\"Name\",\"Root\",\"Description\"\n\"S\", \"c:\\scripts\"\n\"T\",$(Join-Path \"C:\\\" 'training')\n\"P\",$(Join-Path \"C:\\\" 'presentations'),\n\"Downloads\", $(Join-Path -path $env:userprofile -childpath downloads)\n\"Docs\",$([environment]::GetFolderPath(\"MyDocuments\")),\"my Documents folder\"\n\"Drop\",$(Join-Path -path $env:userprofile -childpath dropbox)\n\"One\", $env:OneDriveConsumer,\"my OneDrive folder\"\n\"GDrive\", $(Join-Path -path $env:userprofile -childpath \"Google Drive\")\n\"Scores\", $(Join-Path -path $env:userprofile -childpath documents\\musescore3\\scores)\n\"@<\/code><\/pre>\n\n\n\n<p>I could have created an external CSV file to import, but by putting my data in the script file using a here-string, I can use PowerShell variables. $Drivedata is an in-memory CSV file. I can use ConvertFrom-CSV to \"import\" it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.png\"><img loading=\"lazy\" decoding=\"async\" width=\"758\" height=\"320\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.png\" alt=\"\" class=\"wp-image-8573\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.png 758w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv-300x127.png 300w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/a><\/figure>\n\n\n\n<p>This means I can use this data to create a New-PSDrive with code like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">#create the PSDrive if it doesn't already exist and the root path exists\n(ConvertFrom-Csv $drivedata).where({\n     -Not (Test-Path \"$($_.name):\\\") -AND (Test-Path $_.root) }).foreach({\n         $splat = @{\n             Name = $_.Name\n             Root =$_.root\n             PSProvider = 'FileSystem'\n         }\n         if ($_.Description) { $splat.Add(\"Description\",$_.Description)}\n         [void](New-PSDrive @splat) })<\/code><\/pre>\n\n\n\n<p>This code is using the Where() and ForeEach() methods instead of Where-Object and Foreach-Object because the methods run a little faster. This is code that is called from my PowerShell profile script so I want it to run quickly. Technically, this is a one-line command but you could easily break it into separate steps. The expression is testing if the drive doesn't already exist and that the specified root does. For each matching result, I'm building a hashtable, $splat, with parameters that will be splatted to New-PSDrive. I have to test if there is a description value and add it when found. Finally, New-PSDrive is run. The [void]() syntax prevents the New-PSDrive from displaying the results. You could also pipe New-PSDrive to Out-Null, but technically, using [void] is a few milliseconds faster. This should map all local PSDrives.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Where Am I<\/h2>\n\n\n\n<p>However, I also have a few PSDrives that I map to my NAS device when I am home. I guess I could add them to the code above since I'm testing if the root exists, but to improve performance a bit, I went a different route. I decided to use the Get-NetNeighbor command to verify I can reach the NAS device. I found this faster than pinging, or the PowerShell equivalent. If the MAC address matches the expected MAC, I can map drives.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">#test for NAS MAC and only process NAS drives if at home\nTry {\n    $gw = Get-NetNeighbor -IPAddress 172.16.10.100 -ErrorAction Stop\n\n    if ($gw.LinkLayerAddress -eq '00-11-32-58-7B-10') {\n\n        #map local drives for admin mode\n        $mapped = @{\n            M      = \"\\\\ds416\\media\"\n            N      = \"\\\\ds416\\files\"\n            V      = \"\\\\ds416\\video\"\n            Backup = \"\\\\ds416\\backup\"\n        }\n\n      ($mapped.GetEnumerator()).ForEach({\n                if (! (Test-Path \"$($_.name):\")) {\n                    [void](New-PSDrive -Name $_.name -PSProvider FileSystem -Root $_.value)\n                } #if not test-path\n            })\n    } #if MAC matches NAS\n}\nCatch {\n    Write-Warning \"You are not at home or DS416 is offline.\"\n}<\/code><\/pre>\n\n\n\n<p>I suppose I don't need to test the MAC address because if Get-NetNeigbor fails, I'm most likely on a travel computer. But, just in case I'm home and something is messed up with IP Addressing, the extra check doesn't hurt anything. In this code, I'm mapping drives a little bit differently. Here, $mapped is a hashtable of drive letters and roots. Using the GetEnumerator() method and create the new PSDrive if it doesn't already exist.<\/p>\n\n\n\n<p>All of the code I've shown you is in a script file that replicates between systems. In my PowerShell profile script, I dot source the file. I do the same thing in my Windows PowerShell and PowerShell 7 CurrentUserAllHosts profile scripts. Regardless of version or host, I should always have access to all of my PSDrives.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Doing More<\/h2>\n\n\n\n<p>Because I can't help myself, I needed to have fun working with PSDrives, especially those that belong to the file system. But I'll save that for another day.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Because I spend my day working from a PowerShell prompt, I rely heavily on PSDrives to quickly access files and folders. And because I am mobile, I might be working at my desk in my home office, or I might be on the road with my trusty Thinkpad. Of course, this means, I want an&#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 on the blog: Fun with Mapping #PowerShell Drives","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":[8],"tags":[534,540],"class_list":["post-8572","post","type-post","status-publish","format-standard","hentry","category-scripting","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Fun with Mapping PowerShell Drives &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"I spend my day working from a PowerShell prompt. I rely heavily on PSDrives. Here&#039;s how I manage them including when I travel.\" \/>\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\/scripting\/8572\/fun-with-mapping-powershell-drives\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fun with Mapping PowerShell Drives &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I spend my day working from a PowerShell prompt. I rely heavily on PSDrives. Here&#039;s how I manage them including when I travel.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-22T17:42:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-22T17:42:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.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\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Fun with Mapping PowerShell Drives\",\"datePublished\":\"2021-09-22T17:42:19+00:00\",\"dateModified\":\"2021-09-22T17:42:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/\"},\"wordCount\":613,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/convert-csv.png\",\"keywords\":[\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/\",\"name\":\"Fun with Mapping PowerShell Drives &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/convert-csv.png\",\"datePublished\":\"2021-09-22T17:42:19+00:00\",\"dateModified\":\"2021-09-22T17:42:23+00:00\",\"description\":\"I spend my day working from a PowerShell prompt. I rely heavily on PSDrives. Here's how I manage them including when I travel.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/convert-csv.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/convert-csv.png\",\"width\":758,\"height\":320},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/8572\\\/fun-with-mapping-powershell-drives\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Scripting\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/scripting\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fun with Mapping PowerShell Drives\"}]},{\"@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":"Fun with Mapping PowerShell Drives &#8226; The Lonely Administrator","description":"I spend my day working from a PowerShell prompt. I rely heavily on PSDrives. Here's how I manage them including when I travel.","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\/scripting\/8572\/fun-with-mapping-powershell-drives\/","og_locale":"en_US","og_type":"article","og_title":"Fun with Mapping PowerShell Drives &#8226; The Lonely Administrator","og_description":"I spend my day working from a PowerShell prompt. I rely heavily on PSDrives. Here's how I manage them including when I travel.","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/","og_site_name":"The Lonely Administrator","article_published_time":"2021-09-22T17:42:19+00:00","article_modified_time":"2021-09-22T17:42:23+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.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\/scripting\/8572\/fun-with-mapping-powershell-drives\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Fun with Mapping PowerShell Drives","datePublished":"2021-09-22T17:42:19+00:00","dateModified":"2021-09-22T17:42:23+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/"},"wordCount":613,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.png","keywords":["PowerShell","Scripting"],"articleSection":["Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/","name":"Fun with Mapping PowerShell Drives &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.png","datePublished":"2021-09-22T17:42:19+00:00","dateModified":"2021-09-22T17:42:23+00:00","description":"I spend my day working from a PowerShell prompt. I rely heavily on PSDrives. Here's how I manage them including when I travel.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.png","width":758,"height":320},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Scripting","item":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},{"@type":"ListItem","position":2,"name":"Fun with Mapping PowerShell Drives"}]},{"@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":8575,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/","url_meta":{"origin":8572,"position":0},"title":"Extending PowerShell PSDrives","author":"Jeffery Hicks","date":"September 23, 2021","format":false,"excerpt":"Yesterday I shared some PowerShell code I use to managing my PSDrive assignments. My code works for me in my environment. But that doesn't mean it is necessarily right for you and your environment. There are plenty of ways to use PowerShell to achieve the same results as my code.\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\/2021\/09\/drive-cmds.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/drive-cmds.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/drive-cmds.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/drive-cmds.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8585,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8585\/i-need-a-psdrive-now\/","url_meta":{"origin":8572,"position":1},"title":"I Need a PSDrive Now!","author":"Jeffery Hicks","date":"September 24, 2021","format":false,"excerpt":"I hope you've been enjoying the last few posts on working with PSDrives. To round out the set, I thought I'd remind you of a command in the PSScriptTools module that I use often, especially when teaching a live class or presenting at a conference. As you've seen, I use\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/npsd-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/npsd-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/npsd-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/npsd-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6547,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-core\/6547\/updating-powershell-core-windows-compatibility\/","url_meta":{"origin":8572,"position":2},"title":"Updating PowerShell Core Windows Compatibility","author":"Jeffery Hicks","date":"February 26, 2019","format":false,"excerpt":"I thought I'd share a quick update on my experiences in living in a PowerShell Core world. One of the things that Microsoft is working on to make this easier is a way to access your Windows PowerShell modules that will work in PowerShell Core. It does this through commands\u2026","rel":"","context":"In &quot;PowerShell Core&quot;","block_context":{"text":"PowerShell Core","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-core\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-17.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-17.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-17.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-17.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7386,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7386\/psdrives-shortcuts-and-links\/","url_meta":{"origin":8572,"position":3},"title":"PSDrives, Shortcuts and Links","author":"Jeffery Hicks","date":"April 15, 2020","format":false,"excerpt":"I'll be honest. I've never been much of a OneDrive user. Even though I'm a great candidate given that I use multiple systems and need access to a common set of files. But for a number of reasons I'm beginning to make more of a shift to OneDrive. Part of\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\/04\/tools-link.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/04\/tools-link.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/04\/tools-link.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/04\/tools-link.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2441,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2441\/fun-with-psdrive-locations\/","url_meta":{"origin":8572,"position":4},"title":"Fun with PSDrive Locations","author":"Jeffery Hicks","date":"July 10, 2012","format":false,"excerpt":"A PowerShell PSDrive is a mapping between a PowerShell provider and a resource. The majority of our work is done in a file system PSDrive that corresponds to a file system drive. Let me show you a little trick that might come in handy with a PSDrive. My \"trick\" should\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\/07\/map-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2162,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2162\/friday-fun-get-next-available-drive-letter\/","url_meta":{"origin":8572,"position":5},"title":"Friday Fun: Get Next Available Drive Letter","author":"Jeffery Hicks","date":"April 6, 2012","format":false,"excerpt":"A few days ago I saw on question, I think on Facebook, about using PowerShell to find the next available drive letter that could be used for mapping a network drive. Before I show you my approach, let me state that if you need to map a drive in PowerShell\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/04\/computereye-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8572","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=8572"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8572\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}