Find Jobs
Hire Freelancers

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

$10-30 USD

Fechado
Publicado há mais de 5 anos

$10-30 USD

Pago na entrega
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 do Projeto: 17781908

Sobre o projeto

7 propostas
Projeto remoto
Ativo há 5 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
7 freelancers estão ofertando em média $24 USD for esse trabalho
Avatar do Usuário
Hello I have extensive experience with WMI and powershell. I am sure this project is just piece of cake for me.
$25 USD em 1 dia
4,9 (1976 avaliações)
8,1
8,1
Avatar do Usuário
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 em 3 dias
5,0 (53 avaliações)
5,2
5,2

Sobre o cliente

Bandeira do(a) LEBANON
Beirut, Lebanon
0,0
0
Membro desde set. 16, 2018

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.