{"componentChunkName":"component---src-templates-articles-index-jsx","path":"/articles/powershell-for-storage/","result":{"data":{"props":{"adsense":true,"adsenseMobile":null,"byLine":"","canonical":"https://staging.business.com/articles/powershell-for-storage/","content":"<p>PowerShell v5 offers some new features for managing storage, building on the capabilities that were available in PowerShell 4.</p>\n<p><picture class=\"aligncenter full\">In the days before PowerShell, managing disks via the command line was possible, but it wasn't easy and it certainly didn't feel like a unified experience. PowerShell makes storage management tasks not only much easier to accomplish as standalone tasks, but much easier to integrate into an automated workflow.</picture><br><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8db9192a3a4265e8b4594/1200_-900- 1200w, /images/content/5b6/8db9192a3a4265e8b4594/668_-501- 668w, /images/content/5b6/8db9192a3a4265e8b4594/320_-240- 320w\" sizes=\"668px, 100%\"></source></picture></p>\r\n<div>\r\n<p>PowerShell makes storage management much easier by bringing all of the functions that used to be in lots of separate programs with their own syntax into a unified PowerShell experience with a standard syntax and support for the pipeline and other features for doing things in large groups instead of one at a time.</p>\r\n<p>These cmdlets mostly started in PowerShell 4 but PowerShell 5 brings us some interesting new features for those thinking about server administration from the DevOps mindset of configuration as code where Desired State Configuration (DSC) is the order of the day and servers configure themselves based on our configuration scripts.</p>\r\n<p>You can get a start on what's changed for PowerShell 5 <a href=\"http://mikefrobbins.com/2014/09/04/new-modules-cmdlets-and-parameters-in-powershell-version-5/\" target=\"_blank\">here</a>, and read more details about the *-item cmdlets support for different kinds of links <a href=\"https://msdn.microsoft.com/en-us/powershell/wmf/feedback_symbolic\" target=\"_blank\">here</a>.<br><br>Now, let's take a look at some of the essential PowerShell cmdlets for auditing and maintaining storage.</p>\r\n</div>\r\n<h2>Getting Disk Information</h2>\r\n<p>You might remember in the old days, if you wanted to get information about disks you opened a CMD window and used DISKPART. That meant launching the program, and using its syntax to navigate your way around. That's gone now and all we have to do is type a single PowerShell cmdlet to get the disk information we need.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:\\&gt; Get-Disk</td>\r\n</tr></tbody></table>\n<p><picture class=\"aligncenter med\"><source srcset=\"/images/content/5b6/8dbf61039ebd9798b4574/742_-260- 742w, /images/content/5b6/8dbf61039ebd9798b4574/412_-144- 412w, /images/content/5b6/8dbf61039ebd9798b4574/206_-72- 206w\" sizes=\"(min-width: 870px) 412px, (min-width: 400px) 38vw, 62%\"></source><img src=\"/images/content/5b6/8dbf61039ebd9798b4574/798-280-\" alt=\"\" width=\"798\" height=\"280\" data-content-img-id=\"5b68dbf61039ebd9798b4574\"></picture></p>\r\n<p>The <strong>Get-Disk</strong> cmdlet will return information about any disk attached to the current operating system, but we can use different cmdlets to get information about disks that are presented to us as either as physical disks or as virtual disks separately. We can use <strong>Get-PhysicalDisk</strong> to get information about disks the operating system sees as physical disks, and <strong>Get-VirtualDisk</strong> to see information about virtual disks created from storage pools, <a href=\"http://comparexusa.com/general/how-to-use-windows-server-storage-spaces-in-microsoft-azure/\" target=\"_blank\">which you can also do in Azure</a>. To see that information separately you can use the cmdlets as shown below.</p>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8dc6292a3a4a65a8b45ae/1200_-445- 1200w, /images/content/5b6/8dc6292a3a4a65a8b45ae/668_-248- 668w, /images/content/5b6/8dc6292a3a4a65a8b45ae/320_-118- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8dc6292a3a4a65a8b45ae/797-296-\" alt=\"\" width=\"797\" height=\"296\" data-content-img-id=\"5b68dc6292a3a4a65a8b45ae\"></picture></p>\r\n<p>Up to this point though we still don't know which drives we will see if we open the File Explorer. To see those we can use <strong>Get-Volume</strong>, or as I prefer since we don't care very much about CD-ROM disks or Floppy disks in virtual environments, we can use <strong>Get-Partition</strong> to look at the assigned drive letters and the physical disks they reside on.</p>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8dc9051ee47a7678b45a9/1200_-766- 1200w, /images/content/5b6/8dc9051ee47a7678b45a9/668_-426- 668w, /images/content/5b6/8dc9051ee47a7678b45a9/320_-204- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8dc9051ee47a7678b45a9/798-510-\" alt=\"\" width=\"798\" height=\"510\" data-content-img-id=\"5b68dc9051ee47a7678b45a9\"></picture></p>\r\n<p>You may have noticed that although there were three physical disks returned from Get-PhysicalDisk, there are only two volumes and two partitions returned in the output above. The reason for this is that I have attached a physical disk to this VM through the Azure management portal, but I haven't prepped that disk's storage space for use or assigned it a drive letter yet.</p>\r\n<div>\r\n<h2>Using New Storage Space</h2>\r\n<p>The output returned from Get-PhysicalDisk showed us that Physical Disk number 2 had a partition style of RAW. If you're used to looking at the GUI that means it's Unallocated Space.</p>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8dcaf1039eb1b728b457c/1200_-572- 1200w, /images/content/5b6/8dcaf1039eb1b728b457c/668_-318- 668w, /images/content/5b6/8dcaf1039eb1b728b457c/320_-152- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8dcaf1039eb1b728b457c/995-475-\" alt=\"\" width=\"995\" height=\"475\" data-content-img-id=\"5b68dcaf1039eb1b728b457c\"></picture></p>\r\n<p>To turn this space into a drive we need to complete a few tasks, which is now easily done without resorting to clicking around with the mouse.</p>\r\n<p>First we initialize the disk using the <strong>Initialize-Disk</strong> cmdlet.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:\\&gt; Initialize-Disk -Number 2</td>\r\n</tr></tbody></table>\n<p>That command won't return any output. It will just return control of the console when it's done. The next task is to create a new partition on the drive. We are actually going to create two partitions on this drive just to show how easy formatting is in the next step.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:\\&gt; New-Partition -DiskNumber 2 -AssignDriveLetter -Size 500gb</td>\r\n</tr></tbody></table>\n<p><br><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8dcdd1039eb6d708b4575/1200_-259- 1200w, /images/content/5b6/8dcdd1039eb6d708b4575/668_-144- 668w, /images/content/5b6/8dcdd1039eb6d708b4575/320_-69- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8dcdd1039eb6d708b4575/578-125-\" alt=\"\" width=\"578\" height=\"125\" data-content-img-id=\"5b68dcdd1039eb6d708b4575\"></picture></p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:\\&gt; New-Partition -DiskNumber 2 -AssignDriveLetter –UseMaximumSize</td>\r\n</tr></tbody></table>\n<p><br><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8dcf751ee47c5588b45a4/1200_-340- 1200w, /images/content/5b6/8dcf751ee47c5588b45a4/668_-189- 668w, /images/content/5b6/8dcf751ee47c5588b45a4/320_-90- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8dcf751ee47c5588b45a4/575-163-\" alt=\"\" width=\"575\" height=\"163\" data-content-img-id=\"5b68dcf751ee47c5588b45a4\"></picture></p>\r\n<p>Now when we invoke <strong>Get-Partition</strong> we see the output below.</p>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8dd1d92a3a4e65d8b459f/1200_-671- 1200w, /images/content/5b6/8dd1d92a3a4e65d8b459f/668_-373- 668w, /images/content/5b6/8dd1d92a3a4e65d8b459f/320_-179- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8dd1d92a3a4e65d8b459f/595-333-\" alt=\"\" width=\"595\" height=\"333\" data-content-img-id=\"5b68dd1d92a3a4e65d8b459f\"></picture></p>\r\n<p>By invoking a single command twice we have allocated two new partitions on our disk. Despite having a drive letter though, you can't go charging off and putting folders and files on them just yet. We still need to format these disks.<br><br>To do that we will use <strong>Format-Volume</strong>, but when we use that cmdlet we are only going to invoke a single time to format both of these new drives. To find out how this is possible take a look at the screenshot below.</p>\r\n<p><picture class=\"aligncenter med\"><source srcset=\"/images/content/5b6/8dd4851ee473e308b457c/742_-313- 742w, /images/content/5b6/8dd4851ee473e308b457c/412_-173- 412w, /images/content/5b6/8dd4851ee473e308b457c/206_-86- 206w\" sizes=\"(min-width: 870px) 412px, (min-width: 400px) 38vw, 62%\"></source><img src=\"/images/content/5b6/8dd4851ee473e308b457c/502-212-\" alt=\"\" width=\"502\" height=\"212\" data-content-img-id=\"5b68dd4851ee473e308b457c\"></picture></p>\r\n<p>As I type the dash character for the first parameter, autocomplete shows me the parameters available for use. I hit the down arrow to highlight DriveLetter and the tooltip shows me the expected input type. In this case it can take a character array as input. With that in mind we'll give it the two drive letters we just created and it's going to format both drives for us in a single invocation.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:\\&gt; Format-Volume -DriveLetter F,G -FileSystem NTFS</td>\r\n</tr></tbody></table>\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8ddad1039eb50058b4576/1200_-272- 1200w, /images/content/5b6/8ddad1039eb50058b4576/668_-151- 668w, /images/content/5b6/8ddad1039eb50058b4576/320_-72- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8ddad1039eb50058b4576/647-147-\" alt=\"\" width=\"647\" height=\"147\" data-content-img-id=\"5b68ddad1039eb50058b4576\"></picture></p>\r\n<p>When the cmdlet returns control of the prompt we have two new drives ready for use. The one thing we didn't get to do when we formatted those volumes together instead of individually was assign them a label. We can fix that now using the <strong>Set-Volume</strong> cmdlet.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:\\&gt; Set-Volume -DriveLetter F -NewFileSystemLabel \"UserData\"</td>\r\n</tr></tbody></table>\n<div>\r\n<div>\r\n<p>We aren't going to label the G drive because we are going to use it to demonstrate the next two concepts, which will result in deleting it anyway. </p>\r\n</div>\r\n</div>\r\n<h2>Shrinking, Expanding And Deleting Partitions</h2>\r\n<p>Doing these kinds of operations used to be something that involved lots of typing in DISKPART. Now with PowerShell the built-in cmdlets make shrinking, expanding and deleting partitions drop dead easy. We'll start by shrinking the G drive to match the F drive with the simple <strong>Resize-Partition</strong> cmdlet.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:\\&gt; Resize-Partition -DriveLetter G -Size 500gb</td>\r\n</tr></tbody></table>\n<p>That's all it takes to shrink a partition. But now let's say we want to get rid of it completely and then resize the F drive to take up the remaining space. We just invoke <strong>Remove-Partition</strong> on the G drive and then Resize-Partition on the F drive to expand it.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:\\&gt; Remove-Partition -DriveLetter G</td>\r\n</tr></tbody></table>\n<p>When we attempt to resize the remaining F partition to take up the remaining space, however we will run into a snag. Invoking Resize-Partition with the full drive size as a parameter we get an error as shown below.</p>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8ddfd51ee47f15b8b45b7/1200_-202- 1200w, /images/content/5b6/8ddfd51ee47f15b8b45b7/668_-112- 668w, /images/content/5b6/8ddfd51ee47f15b8b45b7/320_-54- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8ddfd51ee47f15b8b45b7/734-124-\" alt=\"\" width=\"734\" height=\"124\" data-content-img-id=\"5b68ddfd51ee47f15b8b45b7\"></picture></p>\r\n<p>Calculating drive sizes is rarely as exact as we might expect when dealing with computers. To solve this issue we can back off the size parameter in increments of .01gb until we find a size that works as shown below, and when we're done we have a single partition for the whole drive, ready for use.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:\\&gt; Resize-Partition -DriveLetter F -Size 1022.87gb</td>\r\n</tr></tbody></table>\n<p>Be careful about deleting and resizing partitions. Invoking these cmdlets will bring up warning dialogs for a reason. Deleting partitions will almost always result in data loss.</p>\r\n<h2>New Features In PowerShell v5</h2>\r\n<p>Most of the Storage module cmdlets are the same for PowerShell 5 as they were in PowerShell 4, but PS5 does have some new features to offer. <br><br>The first one is out of the box support for the PowerShell Gallery. One of the great things the gallery has in store for us when dealing with storage is the <a href=\"https://github.com/PowerShell/xStorage\" target=\"_blank\">xStorage</a> module for PowerShell DSC. </p>\r\n<p>The xStorage module exposes the functionality of the Storage module cmdlets for use with DSC. This is powerful functionality because it allows us to express our configurations declaratively instead of in step by step scripts. To see an example let's delete all of the partitions from disk 2 and for simplicity sake we will configure the drive with the single large volume we ended up with at the end of the previous section.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:&gt; Get-Partition -DiskNumber 2 | Remove-Partition</td>\r\n</tr></tbody></table>\n<p>Now, invoke the following command to install the xStorage module.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:&gt; Install-Module xStorage</td>\r\n</tr></tbody></table>\n<p>To confirm the installation run the following command and see that there are three new resources grouped under a new Module called xStorage.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:&gt; Get-DSCResource</td>\r\n</tr></tbody></table>\n<p>After confirming the installation we can begin writing and executing the following script.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>Configuration DataDisks<br>{<br>    Import-DscResource -ModuleName xStorage<br>    Node Localhost<br>    {<br>        xWaitForDisk Disk2<br>        {<br>            DiskNumber = 2<br>            RetryIntervalSec = 60<br>            RetryCount = 60<br>        }<br>        xDisk GVolume<br>        {<br>            DiskNumber = 2<br>            DriveLetter = 'G'<br>            FSLabel = 'UserData'<br>        }<br>    }<br>}<br>DataDisks -outputpath c:DataDisks<br>Start-DscConfiguration -Path c:dataDisks -wait -force -Verbose</td>\r\n</tr></tbody></table>\n<p>After a lot of verbose output you will have a disk with the new drive letter and label you expect. That script is just a small example of what can be incorporated into a larger DSC script that configures an entire machine.</p>\r\n<p>Another new feature in PowerShell v5 is in an unexpected place. Instead of a new cmdlet we are going to look at the humble <strong>New-Item</strong> cmdlet.  New-Item now supports symbolic links and hard links. Here's an <a href=\"http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/\" target=\"_blank\">oldish writup</a> on the kinds of symbolic links in Windows, but don't worry about the syntax for creating them because PowerShell is going to make this easy.</p>\r\n<p>First we will create a target file in our documents directory with the following script.</p>\r\n<table class=\"editorTblTable editorTblSize100 editorTblStyleStyle1\"><tbody><tr>\n<td>PS C:&gt; \"Test Data\" | Out-File -FilePath $env:USERPROFILEdocumentstestFile.txt</td>\r\n</tr></tbody></table>\n<p>Now we will use the improved New-Item cmdlet in PowerShell 5 to create a symlink as shown in the screenshot below.</p>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8de3492a3a4265e8b4597/1200_-193- 1200w, /images/content/5b6/8de3492a3a4265e8b4597/668_-107- 668w, /images/content/5b6/8de3492a3a4265e8b4597/320_-51- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8de3492a3a4265e8b4597/857-138-\" alt=\"\" width=\"857\" height=\"138\" data-content-img-id=\"5b68de3492a3a4265e8b4597\"></picture></p>\r\n<p>That file is zero bytes and if you look at its icon in the file explorer you will see a shortcut because that's exactly what it is.</p>\r\n<p>Now we can create a Hard Link to the same file and see what that looks like in the next screenshot.</p>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/8de5492a3a4925c8b45a5/1200_-180- 1200w, /images/content/5b6/8de5492a3a4925c8b45a5/668_-100- 668w, /images/content/5b6/8de5492a3a4925c8b45a5/320_-48- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/8de5492a3a4925c8b45a5/832-125-\" alt=\"\" width=\"832\" height=\"125\" data-content-img-id=\"5b68de5492a3a4925c8b45a5\"></picture></p>\r\n<p>This new file has a length that matches the file we linked to. If you open this new file and edit its contents and then close it and open the original file you will find its contents altered as well. <br><br>We can do some powerful things with links like this, but one thing that might bite us in the future is once these links are set up, you can't always tell easily by looking in a file explorer window what is a link and what is real. Fortunately, PowerShell can show us much easier what is a link and what is real. <br><br>If we create a new file at the top level of the c: drive we can see the differences immediately because the <strong>Get-ChildItem</strong> cmdlet will show us immediately, as we can see below.</p>\r\n<p><picture class=\"aligncenter med\"><source srcset=\"/images/content/5b6/8de6f92a3a424518b45b7/742_-196- 742w, /images/content/5b6/8de6f92a3a424518b45b7/412_-109- 412w, /images/content/5b6/8de6f92a3a424518b45b7/206_-54- 206w\" sizes=\"(min-width: 870px) 412px, (min-width: 400px) 38vw, 62%\"></source><img src=\"/images/content/5b6/8de6f92a3a424518b45b7/521-138-\" alt=\"\" width=\"521\" height=\"138\" data-content-img-id=\"5b68de6f92a3a424518b45b7\"></picture></p>\r\n<p>Administering servers with PowerShell is getting better and better, and storage management is just one facet of the awesomeness. Keep exploring and happy PowerShelling. <strong><br></strong></p>\r\n</div>\n","docType":"article","guid":"articles_806ce9b27d0c3ea4c958848fa8906671","lastModified":"2018-09-04T11:00:00.000Z","published":"2018-09-04T11:00:00.000Z","structuredData":null,"subtitle":"PowerShell v5 offers some new features for managing storage.","template":"v1","title":"Essential PowerShell Cmdlets For Auditing And Maintaining Storage","type":"article","author":{"avatar":null,"bio":"Adam Bertram is a 20-year veteran of IT and experienced online business professional. He's an entrepreneur, IT influencer, Microsoft MVP, blogger, trainer and content marketing writer for multiple technology companies. Adam is also the founder of the popular IT career development platform TechSnips. Catch up on Adam's articles at adamtheautomator.com, connect on LinkedIn, or follow him on Twitter at @adbertram or the TechSnips Twitter account at @techsnips_io.","name":"Adam Bertram","image":null,"slug":null,"social":{"facebook":"","linkedin":"https://www.linkedin.com/in/adambertram/","twitter":"https://twitter.com/adbertram","website":"https://www.adamtheautomator.com/"},"status":"enabled","title":null,"type":"Contributing Writer","user":{"imagePath":"https://staging.business.com/images/undefined","profile":{"company":"eGain Communications","jobTitle":"Product Management Analyst","website":""}}},"breadcrumbs":null,"channels":{"primary":{"name":"Technology","slug":"technology"},"sub":{"name":"Technology Solutions","slug":"technology-solutions"}},"meta":{"robots":"index, follow","description":"PowerShell v5 offers some new features for managing storage, building on the capabilities that were available in PowerShell 4.","title":"PowerShell Cmdlets For Storage Management - business.com"},"parsedContent":{"toc":[{"id":"getting-disk-information","title":"Getting Disk Information"},{"id":"using-new-storage-space","title":"Using New Storage Space"},{"id":"shrinking,-expanding-and-deleting-partitions","title":"Shrinking, Expanding And Deleting Partitions"},{"id":"new-features-in-powershell-v5","title":"New Features In PowerShell v5"}],"json":[{"component":"p","children":["PowerShell v5 offers some new features for managing storage, building on the capabilities that were available in PowerShell 4."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":["In the days before PowerShell, managing disks via the command line was possible, but it wasn't easy and it certainly didn't feel like a unified experience. PowerShell makes storage management tasks not only much easier to accomplish as standalone tasks, but much easier to integrate into an automated workflow."]},{"component":"br"},{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8db9192a3a4265e8b4594/1200_-900- 1200w, /images/content/5b6/8db9192a3a4265e8b4594/668_-501- 668w, /images/content/5b6/8db9192a3a4265e8b4594/320_-240- 320w","sizes":"668px, 100%"}}]}]},{"component":"div","children":[{"component":"p","children":["PowerShell makes storage management much easier by bringing all of the functions that used to be in lots of separate programs with their own syntax into a unified PowerShell experience with a standard syntax and support for the pipeline and other features for doing things in large groups instead of one at a time."]},{"component":"p","children":["These cmdlets mostly started in PowerShell 4 but PowerShell 5 brings us some interesting new features for those thinking about server administration from the DevOps mindset of configuration as code where Desired State Configuration (DSC) is the order of the day and servers configure themselves based on our configuration scripts."]},{"component":"p","children":["You can get a start on what's changed for PowerShell 5 ",{"component":"a","props":{"href":"http://mikefrobbins.com/2014/09/04/new-modules-cmdlets-and-parameters-in-powershell-version-5/","target":"_blank"},"children":["here"]},", and read more details about the *-item cmdlets support for different kinds of links ",{"component":"a","props":{"href":"https://msdn.microsoft.com/en-us/powershell/wmf/feedback_symbolic","target":"_blank"},"children":["here"]},".",{"component":"br"},{"component":"br"},"Now, let's take a look at some of the essential PowerShell cmdlets for auditing and maintaining storage."]}]},{"component":"h2","props":{"id":"getting-disk-information"},"children":["Getting Disk Information"]},{"component":"p","children":["You might remember in the old days, if you wanted to get information about disks you opened a CMD window and used DISKPART. That meant launching the program, and using its syntax to navigate your way around. That's gone now and all we have to do is type a single PowerShell cmdlet to get the disk information we need."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:\\> Get-Disk"]}]}]}]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter med"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8dbf61039ebd9798b4574/742_-260- 742w, /images/content/5b6/8dbf61039ebd9798b4574/412_-144- 412w, /images/content/5b6/8dbf61039ebd9798b4574/206_-72- 206w","sizes":"(min-width: 870px) 412px, (min-width: 400px) 38vw, 62%"}},{"component":"img","props":{"src":"/images/content/5b6/8dbf61039ebd9798b4574/798-280-","alt":"","width":"798","height":"280","data-content-img-id":"5b68dbf61039ebd9798b4574"}}]}]},{"component":"p","children":["The ",{"component":"strong","children":["Get-Disk"]}," cmdlet will return information about any disk attached to the current operating system, but we can use different cmdlets to get information about disks that are presented to us as either as physical disks or as virtual disks separately. We can use ",{"component":"strong","children":["Get-PhysicalDisk"]}," to get information about disks the operating system sees as physical disks, and ",{"component":"strong","children":["Get-VirtualDisk"]}," to see information about virtual disks created from storage pools, ",{"component":"a","props":{"href":"http://comparexusa.com/general/how-to-use-windows-server-storage-spaces-in-microsoft-azure/","target":"_blank"},"children":["which you can also do in Azure"]},". To see that information separately you can use the cmdlets as shown below."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8dc6292a3a4a65a8b45ae/1200_-445- 1200w, /images/content/5b6/8dc6292a3a4a65a8b45ae/668_-248- 668w, /images/content/5b6/8dc6292a3a4a65a8b45ae/320_-118- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8dc6292a3a4a65a8b45ae/797-296-","alt":"","width":"797","height":"296","data-content-img-id":"5b68dc6292a3a4a65a8b45ae"}}]}]},{"component":"p","children":["Up to this point though we still don't know which drives we will see if we open the File Explorer. To see those we can use ",{"component":"strong","children":["Get-Volume"]},", or as I prefer since we don't care very much about CD-ROM disks or Floppy disks in virtual environments, we can use ",{"component":"strong","children":["Get-Partition"]}," to look at the assigned drive letters and the physical disks they reside on."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8dc9051ee47a7678b45a9/1200_-766- 1200w, /images/content/5b6/8dc9051ee47a7678b45a9/668_-426- 668w, /images/content/5b6/8dc9051ee47a7678b45a9/320_-204- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8dc9051ee47a7678b45a9/798-510-","alt":"","width":"798","height":"510","data-content-img-id":"5b68dc9051ee47a7678b45a9"}}]}]},{"component":"p","children":["You may have noticed that although there were three physical disks returned from Get-PhysicalDisk, there are only two volumes and two partitions returned in the output above. The reason for this is that I have attached a physical disk to this VM through the Azure management portal, but I haven't prepped that disk's storage space for use or assigned it a drive letter yet."]},{"component":"div","children":[{"component":"h2","props":{"id":"using-new-storage-space"},"children":["Using New Storage Space"]},{"component":"p","children":["The output returned from Get-PhysicalDisk showed us that Physical Disk number 2 had a partition style of RAW. If you're used to looking at the GUI that means it's Unallocated Space."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8dcaf1039eb1b728b457c/1200_-572- 1200w, /images/content/5b6/8dcaf1039eb1b728b457c/668_-318- 668w, /images/content/5b6/8dcaf1039eb1b728b457c/320_-152- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8dcaf1039eb1b728b457c/995-475-","alt":"","width":"995","height":"475","data-content-img-id":"5b68dcaf1039eb1b728b457c"}}]}]},{"component":"p","children":["To turn this space into a drive we need to complete a few tasks, which is now easily done without resorting to clicking around with the mouse."]},{"component":"p","children":["First we initialize the disk using the ",{"component":"strong","children":["Initialize-Disk"]}," cmdlet."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:\\> Initialize-Disk -Number 2"]}]}]}]},{"component":"p","children":["That command won't return any output. It will just return control of the console when it's done. The next task is to create a new partition on the drive. We are actually going to create two partitions on this drive just to show how easy formatting is in the next step."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:\\> New-Partition -DiskNumber 2 -AssignDriveLetter -Size 500gb"]}]}]}]},{"component":"p","children":[{"component":"br"},{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8dcdd1039eb6d708b4575/1200_-259- 1200w, /images/content/5b6/8dcdd1039eb6d708b4575/668_-144- 668w, /images/content/5b6/8dcdd1039eb6d708b4575/320_-69- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8dcdd1039eb6d708b4575/578-125-","alt":"","width":"578","height":"125","data-content-img-id":"5b68dcdd1039eb6d708b4575"}}]}]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:\\> New-Partition -DiskNumber 2 -AssignDriveLetter –UseMaximumSize"]}]}]}]},{"component":"p","children":[{"component":"br"},{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8dcf751ee47c5588b45a4/1200_-340- 1200w, /images/content/5b6/8dcf751ee47c5588b45a4/668_-189- 668w, /images/content/5b6/8dcf751ee47c5588b45a4/320_-90- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8dcf751ee47c5588b45a4/575-163-","alt":"","width":"575","height":"163","data-content-img-id":"5b68dcf751ee47c5588b45a4"}}]}]},{"component":"p","children":["Now when we invoke ",{"component":"strong","children":["Get-Partition"]}," we see the output below."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8dd1d92a3a4e65d8b459f/1200_-671- 1200w, /images/content/5b6/8dd1d92a3a4e65d8b459f/668_-373- 668w, /images/content/5b6/8dd1d92a3a4e65d8b459f/320_-179- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8dd1d92a3a4e65d8b459f/595-333-","alt":"","width":"595","height":"333","data-content-img-id":"5b68dd1d92a3a4e65d8b459f"}}]}]},{"component":"p","children":["By invoking a single command twice we have allocated two new partitions on our disk. Despite having a drive letter though, you can't go charging off and putting folders and files on them just yet. We still need to format these disks.",{"component":"br"},{"component":"br"},"To do that we will use ",{"component":"strong","children":["Format-Volume"]},", but when we use that cmdlet we are only going to invoke a single time to format both of these new drives. To find out how this is possible take a look at the screenshot below."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter med"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8dd4851ee473e308b457c/742_-313- 742w, /images/content/5b6/8dd4851ee473e308b457c/412_-173- 412w, /images/content/5b6/8dd4851ee473e308b457c/206_-86- 206w","sizes":"(min-width: 870px) 412px, (min-width: 400px) 38vw, 62%"}},{"component":"img","props":{"src":"/images/content/5b6/8dd4851ee473e308b457c/502-212-","alt":"","width":"502","height":"212","data-content-img-id":"5b68dd4851ee473e308b457c"}}]}]},{"component":"p","children":["As I type the dash character for the first parameter, autocomplete shows me the parameters available for use. I hit the down arrow to highlight DriveLetter and the tooltip shows me the expected input type. In this case it can take a character array as input. With that in mind we'll give it the two drive letters we just created and it's going to format both drives for us in a single invocation."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:\\> Format-Volume -DriveLetter F,G -FileSystem NTFS"]}]}]}]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8ddad1039eb50058b4576/1200_-272- 1200w, /images/content/5b6/8ddad1039eb50058b4576/668_-151- 668w, /images/content/5b6/8ddad1039eb50058b4576/320_-72- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8ddad1039eb50058b4576/647-147-","alt":"","width":"647","height":"147","data-content-img-id":"5b68ddad1039eb50058b4576"}}]}]},{"component":"p","children":["When the cmdlet returns control of the prompt we have two new drives ready for use. The one thing we didn't get to do when we formatted those volumes together instead of individually was assign them a label. We can fix that now using the ",{"component":"strong","children":["Set-Volume"]}," cmdlet."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:\\> Set-Volume -DriveLetter F -NewFileSystemLabel \"UserData\""]}]}]}]},{"component":"div","children":[{"component":"div","children":[{"component":"p","children":["We aren't going to label the G drive because we are going to use it to demonstrate the next two concepts, which will result in deleting it anyway. "]}]}]},{"component":"h2","props":{"id":"shrinking,-expanding-and-deleting-partitions"},"children":["Shrinking, Expanding And Deleting Partitions"]},{"component":"p","children":["Doing these kinds of operations used to be something that involved lots of typing in DISKPART. Now with PowerShell the built-in cmdlets make shrinking, expanding and deleting partitions drop dead easy. We'll start by shrinking the G drive to match the F drive with the simple ",{"component":"strong","children":["Resize-Partition"]}," cmdlet."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:\\> Resize-Partition -DriveLetter G -Size 500gb"]}]}]}]},{"component":"p","children":["That's all it takes to shrink a partition. But now let's say we want to get rid of it completely and then resize the F drive to take up the remaining space. We just invoke ",{"component":"strong","children":["Remove-Partition"]}," on the G drive and then Resize-Partition on the F drive to expand it."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:\\> Remove-Partition -DriveLetter G"]}]}]}]},{"component":"p","children":["When we attempt to resize the remaining F partition to take up the remaining space, however we will run into a snag. Invoking Resize-Partition with the full drive size as a parameter we get an error as shown below."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8ddfd51ee47f15b8b45b7/1200_-202- 1200w, /images/content/5b6/8ddfd51ee47f15b8b45b7/668_-112- 668w, /images/content/5b6/8ddfd51ee47f15b8b45b7/320_-54- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8ddfd51ee47f15b8b45b7/734-124-","alt":"","width":"734","height":"124","data-content-img-id":"5b68ddfd51ee47f15b8b45b7"}}]}]},{"component":"p","children":["Calculating drive sizes is rarely as exact as we might expect when dealing with computers. To solve this issue we can back off the size parameter in increments of .01gb until we find a size that works as shown below, and when we're done we have a single partition for the whole drive, ready for use."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:\\> Resize-Partition -DriveLetter F -Size 1022.87gb"]}]}]}]},{"component":"p","children":["Be careful about deleting and resizing partitions. Invoking these cmdlets will bring up warning dialogs for a reason. Deleting partitions will almost always result in data loss."]},{"component":"h2","props":{"id":"new-features-in-powershell-v5"},"children":["New Features In PowerShell v5"]},{"component":"p","children":["Most of the Storage module cmdlets are the same for PowerShell 5 as they were in PowerShell 4, but PS5 does have some new features to offer. ",{"component":"br"},{"component":"br"},"The first one is out of the box support for the PowerShell Gallery. One of the great things the gallery has in store for us when dealing with storage is the ",{"component":"a","props":{"href":"https://github.com/PowerShell/xStorage","target":"_blank"},"children":["xStorage"]}," module for PowerShell DSC. "]},{"component":"p","children":["The xStorage module exposes the functionality of the Storage module cmdlets for use with DSC. This is powerful functionality because it allows us to express our configurations declaratively instead of in step by step scripts. To see an example let's delete all of the partitions from disk 2 and for simplicity sake we will configure the drive with the single large volume we ended up with at the end of the previous section."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:> Get-Partition -DiskNumber 2 | Remove-Partition"]}]}]}]},{"component":"p","children":["Now, invoke the following command to install the xStorage module."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:> Install-Module xStorage"]}]}]}]},{"component":"p","children":["To confirm the installation run the following command and see that there are three new resources grouped under a new Module called xStorage."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:> Get-DSCResource"]}]}]}]},{"component":"p","children":["After confirming the installation we can begin writing and executing the following script."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["Configuration DataDisks",{"component":"br"},"{",{"component":"br"},"    Import-DscResource -ModuleName xStorage",{"component":"br"},"    Node Localhost",{"component":"br"},"    {",{"component":"br"},"        xWaitForDisk Disk2",{"component":"br"},"        {",{"component":"br"},"            DiskNumber = 2",{"component":"br"},"            RetryIntervalSec = 60",{"component":"br"},"            RetryCount = 60",{"component":"br"},"        }",{"component":"br"},"        xDisk GVolume",{"component":"br"},"        {",{"component":"br"},"            DiskNumber = 2",{"component":"br"},"            DriveLetter = 'G'",{"component":"br"},"            FSLabel = 'UserData'",{"component":"br"},"        }",{"component":"br"},"    }",{"component":"br"},"}",{"component":"br"},"DataDisks -outputpath c:DataDisks",{"component":"br"},"Start-DscConfiguration -Path c:dataDisks -wait -force -Verbose"]}]}]}]},{"component":"p","children":["After a lot of verbose output you will have a disk with the new drive letter and label you expect. That script is just a small example of what can be incorporated into a larger DSC script that configures an entire machine."]},{"component":"p","children":["Another new feature in PowerShell v5 is in an unexpected place. Instead of a new cmdlet we are going to look at the humble ",{"component":"strong","children":["New-Item"]}," cmdlet.  New-Item now supports symbolic links and hard links. Here's an ",{"component":"a","props":{"href":"http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/","target":"_blank"},"children":["oldish writup"]}," on the kinds of symbolic links in Windows, but don't worry about the syntax for creating them because PowerShell is going to make this easy."]},{"component":"p","children":["First we will create a target file in our documents directory with the following script."]},{"component":"table","props":{"className":"editorTblTable editorTblSize100 editorTblStyleStyle1"},"children":[{"component":"tbody","children":[{"component":"tr","children":[{"component":"td","children":["PS C:> \"Test Data\" | Out-File -FilePath $env:USERPROFILEdocumentstestFile.txt"]}]}]}]},{"component":"p","children":["Now we will use the improved New-Item cmdlet in PowerShell 5 to create a symlink as shown in the screenshot below."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8de3492a3a4265e8b4597/1200_-193- 1200w, /images/content/5b6/8de3492a3a4265e8b4597/668_-107- 668w, /images/content/5b6/8de3492a3a4265e8b4597/320_-51- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8de3492a3a4265e8b4597/857-138-","alt":"","width":"857","height":"138","data-content-img-id":"5b68de3492a3a4265e8b4597"}}]}]},{"component":"p","children":["That file is zero bytes and if you look at its icon in the file explorer you will see a shortcut because that's exactly what it is."]},{"component":"p","children":["Now we can create a Hard Link to the same file and see what that looks like in the next screenshot."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8de5492a3a4925c8b45a5/1200_-180- 1200w, /images/content/5b6/8de5492a3a4925c8b45a5/668_-100- 668w, /images/content/5b6/8de5492a3a4925c8b45a5/320_-48- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/8de5492a3a4925c8b45a5/832-125-","alt":"","width":"832","height":"125","data-content-img-id":"5b68de5492a3a4925c8b45a5"}}]}]},{"component":"p","children":["This new file has a length that matches the file we linked to. If you open this new file and edit its contents and then close it and open the original file you will find its contents altered as well. ",{"component":"br"},{"component":"br"},"We can do some powerful things with links like this, but one thing that might bite us in the future is once these links are set up, you can't always tell easily by looking in a file explorer window what is a link and what is real. Fortunately, PowerShell can show us much easier what is a link and what is real. ",{"component":"br"},{"component":"br"},"If we create a new file at the top level of the c: drive we can see the differences immediately because the ",{"component":"strong","children":["Get-ChildItem"]}," cmdlet will show us immediately, as we can see below."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter med"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/8de6f92a3a424518b45b7/742_-196- 742w, /images/content/5b6/8de6f92a3a424518b45b7/412_-109- 412w, /images/content/5b6/8de6f92a3a424518b45b7/206_-54- 206w","sizes":"(min-width: 870px) 412px, (min-width: 400px) 38vw, 62%"}},{"component":"img","props":{"src":"/images/content/5b6/8de6f92a3a424518b45b7/521-138-","alt":"","width":"521","height":"138","data-content-img-id":"5b68de6f92a3a424518b45b7"}}]}]},{"component":"p","children":["Administering servers with PowerShell is getting better and better, and storage management is just one facet of the awesomeness. Keep exploring and happy PowerShelling. ",{"component":"strong","children":[{"component":"br"}]}]}]}]},"resource":null,"sponsorship":null,"thumbnail":{"path":"https://staging.business.com/images/content/5d0/18e065a215ea2498b4588/1500-0-","caption":"Undrey/Shutterstock","isBlurred":false},"bestPicks":null},"related":{"relatedArticles":[{"title":"PowerShell: Everything You Need to Know","canonical":"https://www.business.com/articles/powershell-everything-you-need-to-know/","slug":"powershell-everything-you-need-to-know","thumbnail":"https://www.business.com/images/content/5b8/998581039eb8f738b457b/1500-0-","dek":"What you need to know to unlock Microsoft PowerShell's full capabilities.","lastModified":"2018-09-05T17:00:00Z","published":"2018-09-05T17:00:00Z","sponsored":false},{"title":"Essential PowerShell Cmdlets For Managing Active Directory","canonical":"https://www.business.com/articles/powershell-active-directory-cmdlets/","slug":"powershell-active-directory-cmdlets","thumbnail":"https://www.business.com/images/content/5cf/90cab7b4374ab068b456f/1500-0-","dek":"Administering Active Directory is one of the most critical roles in any Windows network.","lastModified":"2018-09-04T08:00:00Z","published":"2018-09-04T08:00:00Z","sponsored":false},{"title":"From COVID-19 to Hurricane Season: Disaster Preparedness for Small Business","canonical":"https://www.business.com/articles/business-disaster-prep/","slug":"business-disaster-prep","thumbnail":"https://www.business.com/images/content/5e7/a495e5a215eb11d8b4569/1500-0-","dek":"Natural disasters – whether a hurricane, tornado or outbreak like COVID-19 – can have a disastrous effect on small businesses, but they don't have to. Here's how to weather a disaster successfully.","lastModified":"2020-03-25T15:19:00Z","published":"2018-09-26T07:00:00Z","sponsored":false},{"title":"Using Lean Strategies to Achieve Team Synergy and Efficiency","canonical":"https://www.business.com/articles/lean-strategies-team-efficiency/","slug":"lean-strategies-team-efficiency","thumbnail":"https://www.business.com/images/content/5be/480e49c658a51108b458c/1500-0-","dek":"Learn more about lean manufacturing strategies and how to implement them in your business.","lastModified":"2018-11-08T08:00:00Z","published":"2018-11-08T08:00:00Z","sponsored":false},{"title":"Your Guide to Creating a Small Business Marketing Plan","canonical":"https://www.business.com/articles/sample-marketing-plan-outline-and-template/","slug":"sample-marketing-plan-outline-and-template","thumbnail":"https://www.business.com/images/content/5f3/3e1765a215eb62d8b4567/1500-0-","dek":"Follow these templates and guidelines to get started on creating your business's marketing plan.","lastModified":"2020-08-12T12:28:00Z","published":"2018-03-02T13:00:00Z","sponsored":false},{"title":"Mobile Wallet Guide: Google Pay vs. Apple Pay vs. Samsung Pay - 08-05","canonical":"https://staging.business.com/articles/google-pay-vs-apple-pay-vs-samsung-pay/","slug":"google-pay-vs-apple-pay-vs-samsung-pay","thumbnail":"https://staging.business.com/images/content/5c5/afd7f54d26d67178b458d/1500-0-","dek":"Edit 07-24 - subtitle","lastModified":"2019-08-05T20:58:00Z","published":"2018-06-21T16:05:00Z","sponsored":null},{"title":"Mobile Wallet Guide: Google Pay vs. Apple Pay vs. Samsung Pay","canonical":"https://www.business.com/articles/google-pay-vs-apple-pay-vs-samsung-pay/","slug":"google-pay-vs-apple-pay-vs-samsung-pay","thumbnail":"https://www.business.com/images/content/5c5/e0a269c658a457c8b4591/1500-0-","dek":"You no longer need to carry a bulky wallet filled with numerous credit cards or cash.","lastModified":"2018-06-21T16:06:00Z","published":"2018-06-21T16:05:00Z","sponsored":false},{"title":"How to Hire for Your Business","canonical":"https://www.business.com/articles/how-to-staff-business/","slug":"how-to-staff-business","thumbnail":"https://www.business.com/images/content/5ea/9c8bb9c658aee018b456c/1500-0-","dek":"Sterling Staffing Solutions CEO Stephen Carter shares his tips on staffing your business.","lastModified":"2020-07-31T15:00:00Z","published":"2018-08-16T12:00:00Z","sponsored":false},{"title":"Because Every Penny Counts: The Ultimate Free Tech Toolbox for Startups","canonical":"https://www.business.com/articles/ultimate-free-tech-toolbox-for-startups/","slug":"ultimate-free-tech-toolbox-for-startups","thumbnail":"https://www.business.com/images/content/59f/a346a51ee4783668b459e/1500-0-","dek":"Here are 19 free or low-cost apps and services that can give your startup a boost.","lastModified":"2017-11-01T22:01:00Z","published":"2017-11-01T22:01:00Z","sponsored":false},{"title":"5 Common Facebook Advertising Mistakes (and How to Fix Them)","canonical":"https://www.business.com/articles/5-ways-to-improve-facebook-ads/","slug":"5-ways-to-improve-facebook-ads","thumbnail":"https://www.business.com/images/content/59e/8e39b1039eb465f8b458b/1500-0-","dek":"Many businesses botch or neglect these elements. Here's how to improve your Facebook ads.","lastModified":"2017-10-19T07:00:00Z","published":"2017-10-19T07:00:00Z","sponsored":false},{"title":"How To Manage IIS Websites With PowerShell","canonical":"https://www.business.com/articles/powershell-manage-iis-websites/","slug":"powershell-manage-iis-websites","thumbnail":"https://www.business.com/images/content/5d0/07b2b7b437409688b4568/1500-0-","dek":"When setting up a new website in IIS are you still using the IIS Web Manager?","lastModified":"2018-09-06T07:00:00Z","published":"2018-09-06T07:00:00Z","sponsored":false},{"title":"Use PowerShell to Make WSUS Suck Less","canonical":"https://www.business.com/articles/powershell-windows-software-update-services/","slug":"powershell-windows-software-update-services","thumbnail":"https://www.business.com/images/content/5b8/eca2d92a3a4ee5a8b4574/1500-0-","dek":"Windows Software Update Services can use PowerShell to work with servers and Windows.","lastModified":"2018-09-04T10:00:00Z","published":"2018-09-04T10:00:00Z","sponsored":false}],"relatedReviews":[{"doc_type":"category","thumbnail":"https://staging.business.com/images/rz/5df908cc5a215e8c4a8b4568/conferencecall_Antonio_Diaz_Getty.jpg","canonical":"https://staging.business.com/categories/best-conference-call-services/","title":"The Best Conference Call Services of 2021","dek":"Which conference call service is right for your business in 2021? We review the top-rated services.","slug":"best-conference-call-services","lastModified":"2021-03-17T18:17:00Z"},{"doc_type":"category","thumbnail":"https://staging.business.com/images/rz/5df3d8695a215e58428b4570/POS_GETTY_DERO2084.jpg","canonical":"https://staging.business.com/categories/best-pos-systems/","title":"The Best POS Systems of 2021","dek":"Before you choose a POS system, check out our reviews of the best picks for 2021. ","slug":"best-pos-systems","lastModified":"2021-03-17T17:33:00Z"},{"doc_type":"category","thumbnail":"https://staging.business.com/images/rz/5e00d4787b43745d6a8b456e/Laptop_undrey_getty.jpg","canonical":"https://staging.business.com/categories/employee-monitoring-software/","title":"The Best Employee Monitoring Software of 2021","dek":"We've narrowed down the best employee monitoring software for businesses. Check out our best picks and reviews.","slug":"employee-monitoring-software","lastModified":"2021-03-05T15:40:00Z"}],"relatedSponsoredArticles":null}},"pageContext":{"displayModified":"2018-09-04T11:00:00.000Z","template":"v1","title":"Essential PowerShell Cmdlets For Auditing And Maintaining Storage","meta":{"robots":"index, follow"},"docType":"articles","slug":"powershell-for-storage","canonical":"https://staging.business.com/articles/powershell-for-storage/","skipTOC":false}},"staticQueryHashes":[]}