Find Jobs
Hire Freelancers

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

$10-30 USD

已关闭
已发布超过 5 年前

$10-30 USD

货到付款
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: 17781908

关于此项目

7提案
远程项目
活跃5 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
7威客以平均价$24 USD来参与此工作竞价
用户头像
Hello I have extensive experience with WMI and powershell. I am sure this project is just piece of cake for me.
$25 USD 在1天之内
4.9 (1976条评论)
8.1
8.1
用户头像
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 在3天之内
5.0 (53条评论)
5.2
5.2

关于客户

LEBANON的国旗
Beirut, Lebanon
0.0
0
会员自9月 16, 2018起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。