Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Powershell Get-WmiObject -Class Win32_LogicalDisk -ComputerName $k - not substitutes variable

$
0
0

hello

This is my first post, please be understanding.

This is my script

$hosty = net view
foreach ($j in $hosty) {
    if ($j -match 'ROW') { 
        $k = $j -replace '\\*'
        ForEach ( $i in (Get-WmiObject -Class Win32_LogicalDisk -ComputerName $k)) {
            $partycja = $i.DeviceID
                $wolne = $i.FreeSpace
                $rozmiar = $i.Size
                $nazwa = $i."Nazwa: $j""Partycja: $partycja""Miejsce wolne: {0:#.00 GB}" -f ($wolne / 1GB)
            }
        }
    }

Variable $k is not substitutes.

Please Help


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>