Find Jobs
Hire Freelancers

create powershell script to get result of get-wmiobject with if and elsif statement

$10-30 USD

Ditutup
Dibuat lebih dari 5 tahun yang lalu

$10-30 USD

Dibayar ketika dikirim
hello I want to use get-wmiobject to totalphysicalmemory, and numberofcores, and array contain several processes should be compared with get-process result they should be two conditions true or false for example if totalphysical memory =< 20158 MB the script should exit if the numberofcore =< 2 the script should exit otherwise it will contiue I already coded some lines but of course need fine-tune please find the code below ------------CODE START HERE------------------ $CPU = get-wmiobject -class win32_processor | select-object -property NumberOfCores #$Mem = get-wmiobject -computer localhost win32_computersystem | select-object @{n="";e={[math]::truncate($[login to view URL] / 1MB)}} Foreach ($D in $CPU) { $CPU = $[login to view URL] If ($[login to view URL] -le $2) {Write-Host "$denied"} Sleep 5 Elseif #$Mem = $[login to view URL] ($[login to view URL] -le $2048) {Write-Host "$denied"} Sleep 5 Else {Write-Host "$success"} } @("[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]","[login to view URL]") | Foreach-object { if((Get-Process $_ -ErrorAction SilentlyContinue) -eq $null) {Write-Host "$success"} else {Write-Host "$denied"} end if ------CODE END HERE-----
ID Proyek: 17781908

Tentang proyek

7 proposal
Proyek remot
Aktif 5 tahun yang lalu

Ingin menghasilkan uang?

Keuntungan menawar di Freelancer

Tentukan anggaran dan garis waktu Anda
Dapatkan bayaran atas pekerjaan Anda
Uraikan proposal Anda
Gratis mendaftar dan menawar pekerjaan
7 freelancers are bidding on average $24 USD for this job
Avatar Pengguna
Hello I have extensive experience with WMI and powershell. I am sure this project is just piece of cake for me.
$25 USD dalam 1 hari
4,9 (1976 ulasan)
8,1
8,1
Avatar Pengguna
Hello Mr. I can help you with this powershell script. I would like to know more about this project. contact me by chat to get more information. Best Regards
$30 USD dalam 3 hari
5,0 (53 ulasan)
5,2
5,2

Tentang klien

Bendera LEBANON
Beirut, Lebanon
0,0
0
Anggota sejak Sep 16, 2018

Verifikasi Klien

Terima kasih! Kami telah mengirim Anda email untuk mengklaim kredit gratis Anda.
Anda sesuatu yang salah saat mengirimkan Anda email. Silakan coba lagi.
Pengguna Terdaftar Total Pekerjaan Terpasang
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuat pratinjau
Izin diberikan untuk Geolokasi.
Sesi login Anda telah kedaluwarsa dan Anda sudah keluar. Silakan login kembali.