Reddit » PowerShell
1,691 FOLLOWERS
A subreddit for Powershell users. PowerShell is a cross-platform (Windows, Linux, and macOS) automation tool and configuration framework optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models.
Reddit » PowerShell
7h ago
Hello,
I am currently running into an issue at work where I cannot install RSAT on my computer, can you help me.
I ran the command, "Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property DisplayName, State" on cmd and it didn't work so I tried to use settings and nothing comes up.
Has anyone had this issue and how did you fix it?
submitted by /u/Radqr
[visit reddit] [comments ..read more
Reddit » PowerShell
7h ago
Powershell-script-menu-gui looks like the perfect tool for quickly loading up scripts with hardcoded options… or scripts having logic to collect data like a grid view popup.
I have a ton of scripts that require 1+ servers to be chosen and then a bunch more that require 1-2 params.
Anything similar but allowing for params?
If not, it’s easy enough to create a hardcoded winforms to hardcode textboxes to a few scripts, I just didn’t want to do a lame job reinventing the wheel
submitted by /u/DarthOpossum
[visit reddit] [comments ..read more
Reddit » PowerShell
7h ago
I have some very basic code I use to search CSV audit files for specific strings. I'll copy the files from the device to c:\1 on my machine and then run this to search for 'STRING' in the 'path/from' column
Get-ChildItem 'C:\1' -Recurse | ForEach-Object { Import-Csv $_.FullName | Where-Object { $_.'path/from' -like '*STRING*' } } | Export-Csv 'C:\1\branded.csv' -NoTypeInformation
Keep getting this though
Import-Csv : Access to the path 'C:\1\20240327' is denied. At line:2 char:3 + Import-Csv $_.FullName | Where-Object { $_.'path/from' -like '*/DEP ... + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryIn ..read more
Reddit » PowerShell
7h ago
So maybe I'm just not asking google the right questions but I'm having a hard time finding the cmdlet I'm looking for. I have multiple teams sites that I need to add folders to their document libraries. For the life of me I can't seem to find the cmdlet I'm looking for to do this in powershell. I've encountered boat loads of "How to do this with Add-PnPFolder" but I'm a little sketched out about the untrusted repository I have to accept in order to use it and I literally don't have the time to research security around it. Surely there is a regular ass PowerShell cmdlet to create a folder in a ..read more
Reddit » PowerShell
7h ago
Apologies if this is a dumb question. Can I use PowerShell to extract and use data from a web system/web database? E.g. extract device info from Ivanti. How would i do this?
submitted by /u/Bc0nn0r98
[visit reddit] [comments ..read more
Reddit » PowerShell
7h ago
Good evening everyone. :) We use the following approach for patching Windows Servers, using PowerShell:
https://devblogs.microsoft.com/scripting/hey-scripting-guy-how-can-i-search-for-download-and-install-an-update/
It works very well, but, I think, starting Windows Server 2019, it was noticed, that in "Update History" section of "Update & Security" recently installed updates are not shown, when script is used to perform the installation. If programmatically download updates and then press "Install now" manually, then it's fine. Does anyone know-is it possible to reflect recently installe ..read more
Reddit » PowerShell
7h ago
A team has a oddball app that requires computers be added to an AD group, but there is a maximum number of computers that can be in each group. So computers are divided between several AD groups.
This is a huge maintenance headache for both the help desk who adds them initially, and the team that is ultimately responsible for it.
They have requested a script that they can run to manage this, but I've been having a hard time finding the logic required to pull it off.
Basically it needs to take an inventory of several groups, and then distribute the members across those groups evenly (as much a ..read more
Reddit » PowerShell
7h ago
This revolves around use cases in which you need to add authentication keys and\or credentials to your powershell script in order for it to be able to access a resource but don't want it to show in clear text in your script.
Key point is that it needs to be scalable.
I know of two methods of doing this.
Method 1:
Create EFS certificate with SYSTEM account.
Add password information to a text file.
Encrypt text file with EFS certificate.
Export EFS certificate with private key
Distribute EFS certificate to all target endpoints via a CertPolicy GPO
Distribute encrypted text file along with power ..read more
Reddit » PowerShell
7h ago
How in God's name do I convert strings that represents dates in Euro format to actual DateTime?
I've tried Parse, ParseExact. Is there a way?
submitted by /u/almsfurr
[visit reddit] [comments ..read more
Reddit » PowerShell
7h ago
I'm quite adept at using Invoke-WebRequest for scraping and interacting with websites/maintaining sessions headless, but a colleague has asked for a Powershell script that opens Chrome and logs in (not very secure, I know but it's InfoSec asking so hey ho), they're sending TAB keys and the password, but that doesn't work if the user interacts with the computer whilst this is running.
$pathToChrome = 'C:\Program Files\Google\Chrome\Application\chrome.exe' $tempFolder = '--user-data-dir=c:\temp' # pick a temp folder for user data, not always needed #$startmode = '--start-fullscreen' # '--kiosk ..read more