r/PowerShell • • 7h ago

Question help with a script that replaces all images in a certain folder with a different images

1 Upvotes

Hi, I've been trying to find a script that works for this, and everything I've tried hasn't worked yet. I've tried a couple things from google searches (this and this were the two sources I used) and neither of them work and I have NO CLUE how to edit it so it works for me. so i figured I might as well ask in here because I am not a coding expert by any means :-(

Basically I am just looking for help on creating a script that would essentially replace all files in the folder ExampleName with ExamplePng.png . sorry if this is a really simple thing to do I just don't feel like manually moving liek 4047130 pngs (this is for a game mod for context), like I said I'm level 1 noob at code and have no clue what I'm doing so I'd really appreciate any help, thank you!!!!!


r/PowerShell • • 14h ago

Question Powershell crashes on opening and I can't figure out why.

14 Upvotes

Hi everyone, whenever I try to open powershell, it instantly closes. When I open a new terminal in VScode, I get this error:

Windows PowerShell terminated with the following error:

Could not load file or assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest.

Any help would be greatly appreciated. I have tried repairing my windows installation with sfc /scannow and DISM /Online /Cleanup-Image /RestoreHealth. I don't really know much about powershell. When I don't use VS Code it doesn't even give any error code it just flashes on the screen for half a second and closes.

If this looks familiar to another person's post upon Googling it is because I am having the exact same problem and experience to a tee, so I copied some of their sentences. https://www.reddit.com/r/PowerShell/comments/1gueufj/powershell_wont_open_and_i_cannot_figure_out_why/


r/PowerShell • • 23h ago

Question TTS script is working fine in Powershell ISE but not with Powershell

2 Upvotes

I am having a had time with some tts related software. So I have this script to test the voices:

Add-Type -AssemblyName System.Speech
$synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$synth.SelectVoice("Gabi")
$synth.Speak("Text goes here")

A little somewhat important info: This is a downloaded voice and as the title says it works with ISE but not with Powershell. All the other standard microsoft voices work fine with this script no matter which powershell I'm running them in.

What I find kind of weird is the error I'm getting. When I run this in Powershell I get an error that says the voice can not be found or not installed. How can Powershell ISE see it then? I don't get it.

I checked it, both ISE and normal Powershell is running as admin and they are both x64


r/PowerShell • • 23h ago

News Microsoft Graph PowerShell SDK V2.41 Finally Fixes Assembly Clash

42 Upvotes

The Microsoft Graph PowerShell SDK has long been plagued by assembly clashes that meant it couldn’t be used in the same session as other Microsoft 365 modules. After Microsoft engineering groups looked at the problem for 18 months, a solution was found by MVP Stephen van Rooij and is now available in V2.41. Apart from an issue with old PowerShell V7 versions (which affects Azure Automation runtime environments), the fix looks solid and the SDK can once again be loaded into PowerShell sessions alongside the Exchange Online and Teams modules.

https://office365itpros.com/2026/10/05/microsoft-graph-powershell-sdk-fix/