Change site logos for all SharePoint sites
Reddit » PowerShell
by /u/cjghrcc
16h ago
Hi PS wizards, I have to change the site logo for a couple hundred SharePoint Online sites reasonably urgently. Anyone have a PS script kicking round that will get it done that they can share? ​ Thanks, submitted by /u/cjghrcc [visit reddit] [comments ..read more
Visit website
Script only works when copy-pasting into a powershell window
Reddit » PowerShell
by /u/MullNad2
16h ago
But when I right-click on it and choose Run With Powershell, it doesn't work. Why is this and how can I fix this? Thanks. Things to note: If I run it as admin, it doesn't work. If I run it as standard user from my home directory (open powershell window -> it says PS C:\Users\MyUsername), it works perfectly. So apparently when I right-click on it and choose Run With Powershell, it doesn't run from inside the user's home directory. Anyway how can I fix this guys? Thanks submitted by /u/MullNad2 [visit reddit] [comments ..read more
Visit website
How to use ErrorAction when the command is setting a variable?
Reddit » PowerShell
by /u/jutrust
16h ago
Hello! I have a script using COM objects. Occasionally, the COM object fails to fetch, which crashes the rest of the script. I haven't found a way to prevent the error but I at least want the script to stop running if it happens. ErrorAction Stop has not been working. The script keeps going after the failure. I wonder if this is happening because the command is not just running, it is populating a variable. What would be a good way around this? The line in question: $PowerPoint = New-Object -ComObject PowerPoint.application -ErrorAction Stop submitted by /u/jutrust [visit reddit] [comment ..read more
Visit website
Out-File is removing data when it writes the file.
Reddit » PowerShell
by /u/Batduck
16h ago
I'm trying to run a script on a list of machines over our network. I'm doing it by saving the script itself a variable, then Out-File-ing that variable to the target machine and executing it. It looks like this (the relevant parts, anyway): $computers= @( "Computer1", "Computer2", "Computer3" ) @script= @" $files= @( "File1", "File2", "File3" ) foreach ($i in $files) { Remove-Item -path c:\Path\to\Files\$i } "@ foreach ($i in $computers) { Enter-PSSession $i $script | Out-File -Path c:\temp\remotescript.ps1 .\remotescript.ps1 Remove-Item c:\temp\remotescript.ps1 Exit-PSSession } The proble ..read more
Visit website
Empty strings, semicolon and &
Reddit » PowerShell
by /u/Walmiltur
16h ago
Hi, I'm trying to understand this lines of code: https://ibb.co/YRbDBt9 The things that i don't understand are the following: 1) in che variable c, the first line ends with ; why? 2)after the semicolon there is a & followed by and underscore. What's the purpose of that underscore? 3)the second string in the variable doesn't has any semicolon at the end, why? 4)in the x variable there are """ followed by & c & """". What are those double quotes(three double quotes and four double quotes respectively)?and the 1 at the end? Thank you in advance submitted by /u/Walmiltur [visit reddi ..read more
Visit website
Allow ~50+ third-party Microsoft Teams apps
Reddit » PowerShell
by /u/Elder-Emo-1
16h ago
Client wants to block the download of third-party applications in Teams, but continue to allow the third-party apps that are currently in use. I have a list of around 50 apps that have been used by end users in the last 90 days and there are about 50+ apps in use. In the admin center it will only let me do this one by one, searching for each app and adding it. I really don’t want to manually type in all 50 something apps. I know there’s a Teams module in PowerShell but I don’t know it’s limitations. This would include changing the Team Apps permissions policy. I have the idea to change the po ..read more
Visit website
What options for PowerShell GUI ?
Reddit » PowerShell
by /u/fennecdore
16h ago
Hi I have been tasked to create a GUI to facilitate the usage of our PowerShell scripts (we mainly works with Azure and m365 very little on premise work, no workstations). I know nothing about GUI, I looked a little bit around and I'm not very impressed by what I'm seeing (visually speaking I would like to make something a little bit aesthetically pleasing if possible). What are your go to resources when it comes to GUI ? Any tips and tricks ? submitted by /u/fennecdore [visit reddit] [comments ..read more
Visit website
Winget staging and not installing apps when scripted?
Reddit » PowerShell
by /u/ArdenLyn
16h ago
So we have multi-app kiosk profile that we push out to customers with tablets we manage. I have a custom button on the kiosk page that kicks off a powershell script that basically does a winget upgrade command so the end users can self service keep the main app on the Kiosk profile up to date. For those not used to Kiosk mode, it's pretty locked down, and there's no real way I can just give access to 'only' the Microsoft store app page for the app we want them to be able to download and nothing else, so I resorted to this CLI winget button. Because this a Kiosk user also, it's a basic user ac ..read more
Visit website
Fix ChatGPT Code
Reddit » PowerShell
by /u/Tavern93
1d ago
Hello! ​ Had someone ask me for help to write a script to iterate through each PowerPoint in a folder and save each slide in the PowerPoint as its own file. So for example, if a PowerPoint file had 20 slides in it, we would want 20 different PowerPoint files for each individual slide. ​ I haven't scripted in quite a while and didn't think I would be able to relearn it fast enough to get this working. So I decided to try ChatGPT to see what it could do. ​ Here is the code it gave me: # Define the path to the directory containing the PowerPoint files $path = "C:\Users\spmercier\OneDrive - Burns ..read more
Visit website
Hashtable to Out to CSV
Reddit » PowerShell
by /u/reynolpe
1d ago
I am trying to figure out the most efficient way to process a hashtable that looks like below into an exported csv that is like this. Is the best way just to split the Value on the semi-colon and somehow piece it all together? Hope I'm making sense. Thanks for any guidance provided. CSV OUTPUT Name,DESC,LOC,ENV,ITOWNER,BUSOWNER,VMHOST,SOX,AGE,MAINT,RTO,NOTES Server1,File,Print,Moon,PRD,Mickey Mouse,Daisy Duck,VMCluster,N,1/1/2023,1/1/2023,4 Days, Server2,File, Print,Mars,PRD,Minnie Mouse,Daffy Duck,,N,10/4/2009,12/23/2013,2 Days, ​ HashTable Name Value ---- ----- Server1 DESC=File, Print;LOC ..read more
Visit website

Follow Reddit » PowerShell on Feedspot

Continue with Google
Continue with Apple
OR