User Tools

Site Tools


windows:powershell:insertstorage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
windows:powershell:insertstorage [2013/10/14 22:13]
127.0.0.1 external edit
windows:powershell:insertstorage [2018/05/14 22:00] (current)
Line 6: Line 6:
  
 <code powershell insertStorage.ps1>​ <code powershell insertStorage.ps1>​
-$HostList = Invoke-Sqlcmd -Query "EXEC Windows.Host_Select_HostID_HostName"​ -ServerInstance "​sql1"​ -Database "SysMetrics"+$HostList = Invoke-Sqlcmd -Query "EXEC Windows.Host_Select_HostID_HostName"​ -ServerInstance "​sql1"​ -Database "JiMetrics"
 $HostList | ForEach-Object { $HostList | ForEach-Object {
     $HostName = $_.HostName     $HostName = $_.HostName
Line 24: Line 24:
             $DiskFormat,​ $DiskLabel = $_.FileSystem,​ $_.Label             $DiskFormat,​ $DiskLabel = $_.FileSystem,​ $_.Label
             $sql = "EXEC Windows.Storage_Insert $HostID, '​$DiskPath',​ '​$DiskFormat',​ '​$DiskLabel',​ $DiskSizeGB,​ $DiskFreeGB"​             $sql = "EXEC Windows.Storage_Insert $HostID, '​$DiskPath',​ '​$DiskFormat',​ '​$DiskLabel',​ $DiskSizeGB,​ $DiskFreeGB"​
-            Invoke-Sqlcmd -Query $sql -ServerInstance "​sql1"​ -Database "SysMetrics"+            Invoke-Sqlcmd -Query $sql -ServerInstance "​sql1"​ -Database "JiMetrics"
     }}}     }}}
 </​code>​ </​code>​
windows/powershell/insertstorage.1381806784.txt.gz ยท Last modified: 2018/05/14 21:58 (external edit)