Skip to main content

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.

2 votes
1 answer
61 views

Powershell - Trying to streamline a Get-Service Command

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 ...
RKillcrazy's user avatar
0 votes
0 answers
35 views

Upload/download files from/to Discord channel based on last write time

I have created a script which does the following: Compare the last write times between... local save files for the game Valheim and remote save files (Valheim) on a discord channel where I exchange ...
n1ls's user avatar
  • 1
0 votes
0 answers
28 views

Fastest way of finding if current user has access to a folder with Powershell

I have a Powershell script that selects a random file in a lab environment and then reads, writes, creates, and deletes files to simulate a live environment. This lab also includes folders that I don'...
Tanaka Saito's user avatar
3 votes
1 answer
104 views

Listing first 50 big files in directory and print relative paths and sizes

I use this Powershell command to recursively list first 50 big files in current directory and print relative paths and sizes in MiB. : ...
SebMa's user avatar
  • 131
1 vote
1 answer
277 views

Intune Remediation script to uninstall 7-Zip

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. ...
S. Me's user avatar
  • 13
3 votes
1 answer
60 views

PowerShell Script for Parsing JSON PyPI Package Data and find the latest version

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 ...
Foad's user avatar
  • 361
3 votes
1 answer
64 views

Powershell script that directly executes python script

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 ...
Max Azatian's user avatar
1 vote
1 answer
54 views

Find all unique file owners through Powershell in an NTFS file system

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: ...
Tanaka Saito's user avatar
3 votes
1 answer
47 views

Comparing a set of parameters contained in two separate strings in Powershell

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 ...
Tanaka Saito's user avatar
1 vote
0 answers
30 views

Powershell function output as [pscustomobject]

I am currently working on a function to check for active SQL Server connections. While the function is functional, I find its implementation a bit verbose. Could you provide suggestions or ...
Purclot's user avatar
  • 111
2 votes
1 answer
45 views

Copying data from a network share to another

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. ...
Newborn's user avatar
  • 21
5 votes
2 answers
409 views

Powershell Export function to create environment variables with bash syntax

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 ...
JohnLBevan's user avatar
  • 1,409
1 vote
0 answers
270 views

Java version switcher in PowerShell

I have written a command-line tool to switch between different java versions, and as this is my first larger PowerShell script, I would like to get some feedback on the code. The powershell file ...
chaosflaws's user avatar
1 vote
1 answer
100 views

How to tune my powershell script for best practices?

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: ...
Cell-o's user avatar
  • 295
0 votes
1 answer
42 views

Powershell script real-time monitoring via Windows Service

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 ...
Cell-o's user avatar
  • 295

15 30 50 per page
1
2 3 4 5
19