Questions tagged [powershell]
Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and CIM enabling management of remote Linux systems and network devices.
1
vote
3
answers
99
views
I use PowerShell to retrieve the last two application logs with event ID 654 and calculate the time difference between them. If the time difference between the two logs is more than 30 minutes, I will ...
2
votes
0
answers
39
views
I'm currently updating a ping script I maintain at work, transitioning from WinForms to WPF. Because of this I've started learning about and incorporating runspaces to keep the GUI responsive during ...
0
votes
1
answer
441
views
I've been experiencing frequent issues with my Windows operating system, requiring me to manually run various system health and repair commands (such as DISM, ...
2
votes
1
answer
103
views
I'm a support analyst/help desk technician by trade. Here's a little PowerShell script I've cobbled together over the years to harvest details of Windows client and/or server platforms.
I use this ...
This is part of a larger script but, I feel like this part could be streamlined a bit. The code currently works but I feel like doing a Get-Process call twice is ...
3
votes
1
answer
159
views
I use this Powershell command to recursively list first 50 big files in current directory and print relative paths and sizes in MiB. :
...
I just wanted to have some advice on those remediation scripts; what do you think?
The idea is to detect every 7-Zip installed on the computer and search for those not up to date and uninstall them.
...
3
votes
1
answer
83
views
Following this post, I have a PowerShell script that aims to interact with the Python Package Index (PyPI) to find the latest release of a specified package that is compatible with the current Python ...
Wrote this script after having some problems with clients on Win10 and consequent necessity to ship ultra-bloated .exe file of Python project over the Web to them. This is my first try to write ...
I'm trying to find all unique file owners in an NTFS file system. Getting the number is fairly straightforward, but my current approac is very inefficient:
...
3
votes
1
answer
62
views
I have a situation where I need to compare two strings with each other in a foreach loop that potentially run over millions of rows of data. The two strings will always contain between 1 and 12 ...
2
votes
1
answer
68
views
The code below copies large amount of data. It does so in 2 steps. I was wondering if both step1 and step2 can be done in parallel.
...
A lot of the time when working in DevOps, documentation and code snippets from colleagues will be based on bash. Most of those same commands work seamlessly in PowerShell; but setting environment ...
2
votes
1
answer
137
views
I have written a script for CVE-2023-24932 like below. But I want to improve my script. I am open to new ideas.
Here is my script:
...
I'm using a script to monitor a file. When a pattern is detected, it will send an email to notify someone.
I am creating a Windows Service via NSSM.
My question is : How can I improve performance of ...