<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic PowerShell Command Question in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Command-Question/m-p/103216#M4235</link>
    <description>&lt;P&gt;what is the command for powershell to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- create volume 12gb&lt;/P&gt;&lt;P&gt;- set a volume as thin provisioned&lt;/P&gt;&lt;P&gt;- securitystyle unix&lt;/P&gt;&lt;P&gt;- enable storage efficiency&lt;/P&gt;&lt;P&gt;- autogrow volume&amp;nbsp;&lt;/P&gt;&lt;P&gt;- automatically delete older snapshots&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jun 2025 04:34:15 GMT</pubDate>
    <dc:creator>TDUBB1234</dc:creator>
    <dc:date>2025-06-05T04:34:15Z</dc:date>
    <item>
      <title>PowerShell Command Question</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Command-Question/m-p/103216#M4235</link>
      <description>&lt;P&gt;what is the command for powershell to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- create volume 12gb&lt;/P&gt;&lt;P&gt;- set a volume as thin provisioned&lt;/P&gt;&lt;P&gt;- securitystyle unix&lt;/P&gt;&lt;P&gt;- enable storage efficiency&lt;/P&gt;&lt;P&gt;- autogrow volume&amp;nbsp;&lt;/P&gt;&lt;P&gt;- automatically delete older snapshots&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 04:34:15 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Command-Question/m-p/103216#M4235</guid>
      <dc:creator>TDUBB1234</dc:creator>
      <dc:date>2025-06-05T04:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Command Question</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Command-Question/m-p/103227#M4236</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can easily find the PowerShell CmdLet names and their syntax by importing the DataONTAP module, listing the availableCmdLets and reading the CmdLet Help.&lt;/P&gt;&lt;P&gt;If you are not sure what the CmdLet name is then you can find it by using a wildcard on the object type you are searching for (EG aggregate, volume, qtree, vserver etc)&lt;/P&gt;&lt;P&gt;Here are some examples of how you can get starting searching the DataONTAP powershell module to identify the CmdLet Syntax required:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS&amp;gt;Import-Module DataONTAP&lt;/P&gt;&lt;P&gt;PS&amp;gt;Get-Command -ModuleName DataONTAP&lt;/P&gt;&lt;P&gt;PS&amp;gt;Get-Command *-NcVol*&lt;/P&gt;&lt;P&gt;PS&amp;gt;Get-Help New-NcVol -Full | more&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So to help answer you question with some "examples" (modify to meet the requirements in your environments):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#'------------------------------------------------------------------------------&lt;BR /&gt;#'Set Variables&lt;BR /&gt;#'------------------------------------------------------------------------------&lt;BR /&gt;$clusterName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "cluster1"&lt;BR /&gt;$vserverName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "vserver1"&lt;BR /&gt;$volumeSecurityStyle = "unix"&lt;BR /&gt;$aggregateName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "node1_aggr1"&lt;BR /&gt;$spaceReserve&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "none"&lt;BR /&gt;$volumeName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "volume1"&lt;BR /&gt;$volumeState&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "online"&lt;BR /&gt;$volumeType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "rw"&lt;BR /&gt;$volumeSize&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 12&lt;BR /&gt;$volumeFormat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "g"&lt;BR /&gt;$volumeMaxSize&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 20&lt;BR /&gt;$volumeIncrement&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 2&lt;BR /&gt;#'------------------------------------------------------------------------------&lt;BR /&gt;#'PowerShell DataONTAP CmdLet Examples:&lt;BR /&gt;#'------------------------------------------------------------------------------&lt;BR /&gt;Import-Module DataONTAP&lt;BR /&gt;$username&amp;nbsp;&amp;nbsp;&amp;nbsp; = "admin"&lt;BR /&gt;$password&amp;nbsp;&amp;nbsp;&amp;nbsp; = Read-Host "Please enter the password to connect to cluster ""$clusterName"" as user ""$username""" -AsSecureString&lt;BR /&gt;$credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $password&lt;BR /&gt;Connect-NcController -Name $clusterName -Credential $credentials -HTTPS&lt;BR /&gt;New-NcVol -Name $volumeName -Aggregate $aggregateName -JunctionPath "/$volumeName" -SpaceReserve $spaceReserve -SecurityStyle $volumeSecurityStyle -State $volumeState -Type $volumeType -Size "$volumeSize$volumeFormat" -VserverContext $vserverName&lt;BR /&gt;Set-NcVolAutosize -Name $volumeName -Enabled -MaximumSize "$volumeMaxSize$volumeFormat" -IncrementSize "$volumeIncrement$volumeFormat" -VserverContext $vserverName&lt;BR /&gt;$command = "volume efficiency start -vserver $vserverName -volume $volumeName -scan-old-data true"&lt;BR /&gt;Invoke-NcSsh -Command $command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for deleting old snapshots, see "Get-Help Get-NcSnapShot" and "Get-Help Remove-NcSnapShot" however you shouldn't need to delete old snapshots unless you have taken the snapshot manually as the snapshot policy\schedule assigned to the volume will automatically create\remove them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the list of configuration steps required I think what you are attempting to achieve would be ideal as a WFA workflow.&lt;/P&gt;&lt;P&gt;Have you considered using Workflow automation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 06:03:51 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Command-Question/m-p/103227#M4236</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2015-04-15T06:03:51Z</dc:date>
    </item>
  </channel>
</rss>

