{"id":8575,"date":"2021-09-23T12:30:59","date_gmt":"2021-09-23T16:30:59","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=8575"},"modified":"2021-09-23T12:31:03","modified_gmt":"2021-09-23T16:31:03","slug":"extending-powershell-psdrives","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/","title":{"rendered":"Extending PowerShell PSDrives"},"content":{"rendered":"\n<p>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. This is something you should always keep in mind when looking at someone else's code. But enough caveats. In the <a href=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/\" target=\"_blank\" rel=\"noreferrer noopener\">previous post<\/a> I left you with a tease that there is more to be done with PSDrives. Let's look at that today.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Format Extensions<\/h2>\n\n\n\n<p>By now, you should know that I am a big fan of custom formatting. It saves time and allows me to see information in a format that meets a particular need. Formatting extensions require an XML file, but if you've been reading me for a while, you know about my <a href=\"http:\/\/bit.ly\/31SGo5o\" target=\"_blank\" rel=\"noreferrer noopener\">New-PSFormatXML<\/a> function that is part of the <a href=\"https:\/\/github.com\/jdhitsolutions\/PSScriptTools#readme\" target=\"_blank\" rel=\"noreferrer noopener\">PSScriptTools <\/a>module. I used this command to add a few custom views for PowerShell PSDrives.<\/p>\n\n\n\n<p>When you run Get-PSDrive, PowerShell formats the results using a default view named Drive.  I added a couple of new table views. One of them displays PSDrives grouped by provider.<\/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\/psdrive-provider.png\"><img loading=\"lazy\" decoding=\"async\" width=\"876\" height=\"578\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider.png\" alt=\"\" class=\"wp-image-8577\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider.png 876w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider-300x198.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider-768x507.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider-350x230.png 350w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider-850x561.png 850w\" sizes=\"auto, (max-width: 876px) 100vw, 876px\" \/><\/a><\/figure>\n\n\n\n<p>In order to group properly, you need to remember to sort on the Provider property. Or get a bit more granular with Get-PSDrive.<\/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\/psdrive-provider2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"430\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider2.png\" alt=\"\" class=\"wp-image-8578\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider2.png 940w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider2-300x137.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider2-768x351.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider2-850x389.png 850w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/a><\/figure>\n\n\n\n<p>The Info view is similar but doesn't include the provider.<\/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\/psdrive-info.png\"><img loading=\"lazy\" decoding=\"async\" width=\"674\" height=\"189\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-info.png\" alt=\"\" class=\"wp-image-8579\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-info.png 674w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-info-300x84.png 300w\" sizes=\"auto, (max-width: 674px) 100vw, 674px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Get-FileSystemDrive<\/h2>\n\n\n\n<p>As I was working on these extensions, I realized the FileSystem PSDrives are of more value to me. One thing that has always annoyed me is that I get size and usage information, even for PSDrives that point to folders.<\/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\/psdrive-filesystem.png\"><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"162\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-filesystem.png\" alt=\"\" class=\"wp-image-8580\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-filesystem.png 715w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-filesystem-300x68.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/a><\/figure>\n\n\n\n<p>I wanted something better. This was going to mean more than a format extension. I wrote my own command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">#requires -version 5.1\n\nFunction Get-FileSystemDrive {\n    [cmdletbinding()]\n    [OutputType(\"PSFileSystemDrive\")]\n    [alias(\"gfsd\")]\n    Param(\n        [Parameter(HelpMessage = \" Specifies, as a string array, the name or name of FileSystem PSDrives. Type the drive name or letter without a colon (:)\")]\n        [string[]]$Name\n    )\n    Begin {\n        Write-Verbose \"[$((Get-Date).TimeofDay) BEGIN  ] Starting $($myinvocation.mycommand)\"\n    } #begin\n\n    Process {\n        Write-Verbose \"[$((Get-Date).TimeofDay) PROCESS] Getting FileSystem PSDrives\"\n        Try {\n            $drives = Get-PSDrive @PSBoundParameters -PSProvider FileSystem -ErrorAction Stop\n        }\n        Catch {\n            Throw $_\n        }\n\n        #create a custom object from the drive information\n        if ($drives) {\n            Write-Verbose \"[$((Get-Date).TimeofDay) PROCESS] Found $($drives.count) FileSystem PSDrives\"\n            foreach ($drive in $drives) {\n                #only get size information for root drives\n                #need to account for non-Windows systems\n                if ($drive.root -match \"^(([A-Za-]:)\\\\|\\\/)$\") {\n                    $info = [system.io.driveinfo]::new($drive.root)\n                    if ($info.DriveType -eq 'Fixed') {\n                        Write-Verbose \"[$((Get-Date).TimeofDay) PROCESS] Getting root drive detail for $($info.name)\"\n                        $Free = $info.AvailableFreeSpace\n                        $Used = $info.TotalSize - $info.AvailableFreeSpace\n                        $Format = $info.DriveFormat\n                        $Size = $info.totalSize\n                        $IsPhysical = $True\n                    }\n                    else {\n                        $Free = $null\n                        $Used = $null\n                        $Format = $Null\n                        $Size = $null\n                        $IsPhysical = $False\n                    }\n                }\n                else {\n                    $Free = $null\n                    $Used = $null\n                    $Format = $Null\n                    $Size = $Nuyll\n                    $IsPhysical = $False\n                }\n                [PSCustomObject]@{\n                    PSTypeName      = \"PSFileSystemDrive\"\n                    Name            = $drive.Name\n                    Root            = $drive.Root\n                    CurrentLocation = $drive.CurrentLocation\n                    Description     = $drive.Description\n                    Free            = $free\n                    Used            = $used\n                    Size            = $Size\n                    Format          = $Format\n                    IsPhysical      = $IsPhysical\n                }\n            }\n        }\n\n    } #process\n\n    End {\n        Write-Verbose \"[$((Get-Date).TimeofDay) END    ] Ending $($myinvocation.mycommand)\"\n\n    } #end\n\n} #close Get-FileSystemDrive\n<\/code><\/pre>\n\n\n\n<p>The function is a wrapper for Get-PSDrive that only returns FileSystem drives. For each drive, I create my own custom object using a typename of PSFileSystemDrive. I need a unique typename for custom format and type extensions that are coming. The custom object makes it easier to differentiate between root physical drives like C: and D: from a mapping like T which goes to C:\\Training.<\/p>\n\n\n\n<p>In the same file as the function, I also define a custom type extension to define a script property.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">#add a script property to the custom object\n$value = {\n    if ($this.IsPhysical) {\n        ($this.used\/$this.size)*100\n    }\n    else {\n        $Null\n    }\n}\nUpdate-TypeData -TypeName 'PSFileSystemDrive' -MemberType ScriptProperty -MemberName Utilization -Value $value -force\n<\/code><\/pre>\n\n\n\n<p>If the PSDrive is a physical drive, I'm calculating the utilization percentage. I could have made this a static property when I defined the object. And yes, I could have defined my custom object as a PowerShell class. Which I still might do because I am getting other ideas as I write this. But for now, this is what I have.<\/p>\n\n\n\n<p>I also used New-PSFormatXML to define a default formatted view.<\/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\/filesystemdriveinfo.png\"><img loading=\"lazy\" decoding=\"async\" width=\"742\" height=\"381\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/filesystemdriveinfo.png\" alt=\"\" class=\"wp-image-8581\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/filesystemdriveinfo.png 742w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/filesystemdriveinfo-300x154.png 300w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/a><\/figure>\n\n\n\n<p>I find this output to be more concise and meaningful. Notice that I only get size and usage information for physical drives. My format ps1xml file also uses scriptblocks and ANSI sequences to display usage percentages in color. If the percentage is 90 or above it will be shown in red. Although, if you are using Windows Terminal, the colors may be slightly different depending on your color scheme.<\/p>\n\n\n\n<p>I also created a second view called Status, which works best with physical drives.<\/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\/filesystemdriveinfo-status.png\"><img loading=\"lazy\" decoding=\"async\" width=\"698\" height=\"396\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/filesystemdriveinfo-status.png\" alt=\"\" class=\"wp-image-8582\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/filesystemdriveinfo-status.png 698w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/filesystemdriveinfo-status-300x170.png 300w\" sizes=\"auto, (max-width: 698px) 100vw, 698px\" \/><\/a><\/figure>\n\n\n\n<p>This view doesn't have the ANSI highlighting for utilization, although you could certainly add it.<\/p>\n\n\n\n<p>All of the type extensions are in the same file.<\/p>\n\n\n\n<pre title=\"psdriveinfo.format.ps1xml\" class=\"wp-block-code\"><code lang=\"xml\" class=\"language-xml\">&lt;!--\nFormat type data generated 09\/22\/2021 09:13:30 by PROSPERO\\Jeff\n\nThis file was created using the New-PSFormatXML command that is part\nof the PSScriptTools module.\n\nhttps:\/\/github.com\/jdhitsolutions\/PSScriptTools\n-->\n&lt;Configuration>\n  &lt;ViewDefinitions>\n    &lt;View>\n      &lt;!--Created 09\/22\/2021 09:13:30 by PROSPERO\\Jeff-->\n      &lt;Name>provider&lt;\/Name>\n      &lt;ViewSelectedBy>\n        &lt;TypeName>System.Management.Automation.PSDriveInfo&lt;\/TypeName>\n      &lt;\/ViewSelectedBy>\n      &lt;GroupBy>\n        &lt;ScriptBlock>$_.provider.Name&lt;\/ScriptBlock>\n        &lt;Label>Provider&lt;\/Label>\n      &lt;\/GroupBy>\n      &lt;TableControl>\n        &lt;!--Delete the AutoSize node if you want to use the defined widths.\n        &lt;AutoSize \/>-->\n        &lt;TableHeaders>\n          &lt;TableColumnHeader>\n            &lt;Label>Name&lt;\/Label>\n            &lt;Width>12&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>Root&lt;\/Label>\n            &lt;Width>45&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>CurrentLocation&lt;\/Label>\n            &lt;Width>20&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>Description&lt;\/Label>\n          &lt;\/TableColumnHeader>\n        &lt;\/TableHeaders>\n        &lt;TableRowEntries>\n          &lt;TableRowEntry>\n            &lt;Wrap \/>\n            &lt;TableColumnItems>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Name&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Root&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>CurrentLocation&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Description&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n            &lt;\/TableColumnItems>\n          &lt;\/TableRowEntry>\n        &lt;\/TableRowEntries>\n      &lt;\/TableControl>\n    &lt;\/View>\n    &lt;View>\n      &lt;!--Created 09\/22\/2021 11:15:30 by PROSPERO\\Jeff-->\n      &lt;Name>info&lt;\/Name>\n      &lt;ViewSelectedBy>\n        &lt;TypeName>System.Management.Automation.PSDriveInfo&lt;\/TypeName>\n      &lt;\/ViewSelectedBy>\n      &lt;TableControl>\n        &lt;!--Delete the AutoSize node if you want to use the defined widths.-->\n        &lt;AutoSize \/>\n        &lt;TableHeaders>\n          &lt;TableColumnHeader>\n            &lt;Label>Name&lt;\/Label>\n            &lt;Width>7&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>Root&lt;\/Label>\n            &lt;Width>7&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>CurrentLocation&lt;\/Label>\n            &lt;Width>18&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>Description&lt;\/Label>\n            &lt;Width>14&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n        &lt;\/TableHeaders>\n        &lt;TableRowEntries>\n          &lt;TableRowEntry>\n            &lt;Wrap \/>\n            &lt;TableColumnItems>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Name&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Root&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>CurrentLocation&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Description&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n            &lt;\/TableColumnItems>\n          &lt;\/TableRowEntry>\n        &lt;\/TableRowEntries>\n      &lt;\/TableControl>\n    &lt;\/View>\n    &lt;View>\n      &lt;!--Created 09\/22\/2021 10:02:46 by PROSPERO\\Jeff-->\n      &lt;Name>default&lt;\/Name>\n      &lt;ViewSelectedBy>\n        &lt;TypeName>PSFileSystemDrive&lt;\/TypeName>\n      &lt;\/ViewSelectedBy>\n      &lt;TableControl>\n        &lt;!--Delete the AutoSize node if you want to use the defined widths.-->\n        &lt;AutoSize \/>\n        &lt;TableHeaders>\n          &lt;TableColumnHeader>\n            &lt;Label>Name&lt;\/Label>\n            &lt;Width>7&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>Root&lt;\/Label>\n            &lt;Width>7&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>Current&lt;\/Label>\n            &lt;Width>18&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>SizeGB&lt;\/Label>\n            &lt;Width>15&lt;\/Width>\n            &lt;Alignment>right&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>PctUsed&lt;\/Label>\n            &lt;Width>21&lt;\/Width>\n            &lt;Alignment>right&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>Format&lt;\/Label>\n            &lt;Width>9&lt;\/Width>\n            &lt;Alignment>right&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n        &lt;\/TableHeaders>\n        &lt;TableRowEntries>\n          &lt;TableRowEntry>\n            &lt;TableColumnItems>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Name&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Root&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>CurrentLocation&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;ScriptBlock>\n                  if ($_.size) {\n                    $_.Size\/1GB -AS [int]\n                  }\n                  else {\n                    $null\n                  }\n                  &lt;\/ScriptBlock>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;ScriptBlock>\n                 if ($_.Utilization) {\n                    &lt;!-- display using ANSI-->\n                    if ($host.name -match \"console|code|ServerRemoteHost\") {\n                      $value = [math]::Round($_.Utilization,2)\n                      Switch ($value) {\n                        {$_ -ge 90} {\n                          &lt;!--red-->\n                          \"$([char]27)[90m$value$([char]27)[0m\"\n                        }\n                        {$_ -ge 75} {\n                          &lt;!--yellow-->\n                          \"$([char]27)[38;5;227m$value$([char]27)[0m\"\n                        }\n                        {$_ -ge 50} {\n                          &lt;!--purple-->\n                          \"$([char]27)[95m$value$([char]27)[0m\"\n                        }\n                        default {\n                          &lt;!--green-->\n                          \"$([char]27)[92m$value$([char]27)[0m\"\n                        }\n                      }\n                    }\n                    else {\n                     [math]::Round($_.Utilization,2)\n                    }\n                  }\n                  else {\n                    $null\n                  }\n                &lt;\/ScriptBlock>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Format&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n            &lt;\/TableColumnItems>\n          &lt;\/TableRowEntry>\n        &lt;\/TableRowEntries>\n      &lt;\/TableControl>\n    &lt;\/View>\n    &lt;View>\n      &lt;!--Created 09\/22\/2021 12:39:34 by PROSPERO\\Jeff-->\n      &lt;Name>status&lt;\/Name>\n      &lt;ViewSelectedBy>\n        &lt;TypeName>PSFileSystemDrive&lt;\/TypeName>\n      &lt;\/ViewSelectedBy>\n      &lt;GroupBy>\n        &lt;ScriptBlock>\n        &lt;!--display name using ANSI if supported-->\n        if ($host.name -match \"console|code|ServerRemoteHost\") {\n          $n = \"$([char]27)[92m$($_.Name)$([char]27)[0m\"\n        }\n        else {\n          $n = $_.name\n        }\n        \"{0}`n   Root: {1}\" -f $n,$_.Root\n        &lt;\/ScriptBlock>\n        &lt;Label>Name&lt;\/Label>\n      &lt;\/GroupBy>\n      &lt;TableControl>\n        &lt;!--Delete the AutoSize node if you want to use the defined widths.-->\n        &lt;AutoSize \/>\n        &lt;TableHeaders>\n          &lt;TableColumnHeader>\n            &lt;Label>CurrentLocation&lt;\/Label>\n            &lt;Width>18&lt;\/Width>\n            &lt;Alignment>left&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>SizeGB&lt;\/Label>\n            &lt;Width>7&lt;\/Width>\n            &lt;Alignment>right&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>FreeGB&lt;\/Label>\n            &lt;Width>7&lt;\/Width>\n            &lt;Alignment>Right&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>Utilization&lt;\/Label>\n            &lt;Width>20&lt;\/Width>\n            &lt;Alignment>right&lt;\/Alignment>\n          &lt;\/TableColumnHeader>\n          &lt;TableColumnHeader>\n            &lt;Label>Description&lt;\/Label>\n          &lt;\/TableColumnHeader>\n        &lt;\/TableHeaders>\n        &lt;TableRowEntries>\n          &lt;TableRowEntry>\n            &lt;Wrap \/>\n            &lt;TableColumnItems>\n              &lt;TableColumnItem>\n                &lt;PropertyName>CurrentLocation&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;ScriptBlock>\n                if ($_.IsPhysical) {\n                  $_.Size\/1GB -as [int]\n                }\n                else {\n                  $null\n                }\n                &lt;\/ScriptBlock>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;ScriptBlock>\n                if ($_.IsPhysical) {\n                  $_.Free\/1GB -as [int]\n                }\n                else {\n                  $null\n                }\n                &lt;\/ScriptBlock>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;ScriptBlock>\n                if ($_.IsPhysical) {\n                  [math]::Round($_.Utilization,2)\n                  }\n                else {\n                  $null\n                }\n                &lt;\/ScriptBlock>\n              &lt;\/TableColumnItem>\n              &lt;TableColumnItem>\n                &lt;PropertyName>Description&lt;\/PropertyName>\n              &lt;\/TableColumnItem>\n            &lt;\/TableColumnItems>\n          &lt;\/TableRowEntry>\n        &lt;\/TableRowEntries>\n      &lt;\/TableControl>\n    &lt;\/View>\n  &lt;\/ViewDefinitions>\n&lt;\/Configuration><\/code><\/pre>\n\n\n\n<p>In the file that defines the function, I add this snippet:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Update-FormatData $psscriptroot\\PSDriveInfo.format.ps1xml<\/code><\/pre>\n\n\n\n<p>All of the files are in the same directory which is why I am using $PSScriptRoot. <\/p>\n\n\n\n<p>Now I have commands and options that make my work easier. Sure, I can still use a command like Get-Volume. Or I can use my own command (which has a defined alias).<\/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\/drive-cmds.png\"><img loading=\"lazy\" decoding=\"async\" width=\"856\" height=\"246\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/drive-cmds.png\" alt=\"\" class=\"wp-image-8583\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/drive-cmds.png 856w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/drive-cmds-300x86.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/drive-cmds-768x221.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/drive-cmds-850x244.png 850w\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" \/><\/a><\/figure>\n\n\n\n<p>I hope you'll grab the code and play with it. That is a great way to improve your PowerShell scripting. Have fun!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I shared some PowerShell code I use to managing my PSDrive assignments. My code works for me in my environment. But that doesn&#8217;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. This is something you should&#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: Extending #PowerShell PSDrives","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":[295,224,534,150,540],"class_list":["post-8575","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-format-table","tag-function","tag-powershell","tag-psdrive","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Extending PowerShell PSDrives &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"Here&#039;s how I do even more with PowerShell PSDrives with custom format and type extensions and my own custom functions.\" \/>\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\/8575\/extending-powershell-psdrives\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Extending PowerShell PSDrives &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Here&#039;s how I do even more with PowerShell PSDrives with custom format and type extensions and my own custom functions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-23T16:30:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-23T16:31:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider.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=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Extending PowerShell PSDrives\",\"datePublished\":\"2021-09-23T16:30:59+00:00\",\"dateModified\":\"2021-09-23T16:31:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/\"},\"wordCount\":645,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/psdrive-provider.png\",\"keywords\":[\"format-table\",\"Function\",\"PowerShell\",\"PSDrive\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/\",\"name\":\"Extending PowerShell PSDrives &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/psdrive-provider.png\",\"datePublished\":\"2021-09-23T16:30:59+00:00\",\"dateModified\":\"2021-09-23T16:31:03+00:00\",\"description\":\"Here's how I do even more with PowerShell PSDrives with custom format and type extensions and my own custom functions.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/psdrive-provider.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/psdrive-provider.png\",\"width\":876,\"height\":578},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8575\\\/extending-powershell-psdrives\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Extending PowerShell PSDrives\"}]},{\"@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":"Extending PowerShell PSDrives &#8226; The Lonely Administrator","description":"Here's how I do even more with PowerShell PSDrives with custom format and type extensions and my own custom functions.","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\/8575\/extending-powershell-psdrives\/","og_locale":"en_US","og_type":"article","og_title":"Extending PowerShell PSDrives &#8226; The Lonely Administrator","og_description":"Here's how I do even more with PowerShell PSDrives with custom format and type extensions and my own custom functions.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/","og_site_name":"The Lonely Administrator","article_published_time":"2021-09-23T16:30:59+00:00","article_modified_time":"2021-09-23T16:31:03+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider.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":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Extending PowerShell PSDrives","datePublished":"2021-09-23T16:30:59+00:00","dateModified":"2021-09-23T16:31:03+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/"},"wordCount":645,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider.png","keywords":["format-table","Function","PowerShell","PSDrive","Scripting"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/","name":"Extending PowerShell PSDrives &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider.png","datePublished":"2021-09-23T16:30:59+00:00","dateModified":"2021-09-23T16:31:03+00:00","description":"Here's how I do even more with PowerShell PSDrives with custom format and type extensions and my own custom functions.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/psdrive-provider.png","width":876,"height":578},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8575\/extending-powershell-psdrives\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Extending PowerShell PSDrives"}]},{"@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":8572,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8572\/fun-with-mapping-powershell-drives\/","url_meta":{"origin":8575,"position":0},"title":"Fun with Mapping PowerShell Drives","author":"Jeffery Hicks","date":"September 22, 2021","format":false,"excerpt":"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,\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\/convert-csv.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/convert-csv.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":8575,"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":2441,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2441\/fun-with-psdrive-locations\/","url_meta":{"origin":8575,"position":2},"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":7386,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7386\/psdrives-shortcuts-and-links\/","url_meta":{"origin":8575,"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":6547,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-core\/6547\/updating-powershell-core-windows-compatibility\/","url_meta":{"origin":8575,"position":4},"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":1171,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1171\/powershell-deep-dive-formatting-and-extensions\/","url_meta":{"origin":8575,"position":5},"title":"PowerShell Deep Dive Formatting and Extensions","author":"Jeffery Hicks","date":"February 25, 2011","format":false,"excerpt":"I just found out I will be presenting at the PowerShell Deep Dive April 18-19 that is part of TEC 2011. This promises to be THE PowerShell event everyone has been waiting for. I'll be presenting on format and type extensions. Mastering Format and Type Extensions Windows PowerShell is designed\u2026","rel":"","context":"In &quot;Conferences&quot;","block_context":{"text":"Conferences","link":"https:\/\/jdhitsolutions.com\/blog\/category\/conferences\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8575","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=8575"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8575\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}