[Solved] how to get a pc list that have a service running on each pc?

If all computers have powershell installed with remoting enabled, you can try the script below. It also outputs computers that were not reachable so you can retest them later if you want to. If you don’t need it, just remove the content inside the catch-block(or all of try/catch): $out = @() Get-Content “pclist.txt” | foreach … Read more

[Solved] power shell script to get drive space ( percentage used and free ) [duplicate]

You can try this: Get-WmiObject -Class win32_Logicaldisk -ComputerName localhost | where {($_.DriveType -eq 3 -or $_.DriveType -eq 2) -and $_.FileSystem -ne $null } | Select -Property @{Name=”Volume”;Expression = {$_.DeviceID -replace “:”,””}}, @{Name=”Free”;Expression = { “{0:N0}%” -f (($_.FreeSpace/$_.Size) * 100) } } solved power shell script to get drive space ( percentage used and free ) … Read more

[Solved] multiple exclude rules in powershell

I post this as an answer as I don’t have the characters to do it as comment. Let me see if I understand this. $Files = Get-ChildItem -File C:\Setup | select Name, LastWriteTime You then have an export of the files like: Name LastWriteTime —- ————- SS_MM_Master_Finland_2017.txt 6/27/2018 4:30:09 PM SS_MM_Master_Finland_2018.txt 6/27/2018 4:30:09 PM SS_MM_Master_Germany_2017.txt … Read more

[Solved] how to create ps1 file which takes input as json and based on parameters exceute batch file? [closed]

This is a Batch-file solution (posted here because this question have the batch-file tag) that IMO is simpler than any ps1 solution, but I am sure it run faster than the ps1 solution. @echo off setlocal EnableDelayedExpansion set “Version=” for /F “tokens=1,2 delims=:, ” %%a in (‘findstr “:” input.txt’) do ( set “%%a=%%~b” if defined … Read more