#powershell invoke-restmethod upload file
Explore tagged Tumblr posts
dotnet-helpers-blog · 7 years ago
Text
Upload file with Powershell GUI
Upload file with Powershell GUI
Tumblr media
In this post, we are going to dicuss about the file upload using the Powershell GUI. Instead of thinking highlevel, here i had split the three simple task to achieve the file upload functionality in the powershell.
Create Simple PowerShell UI for browsing the location of files  with one textbox and two button type (upload & cancel) with help of system.Windows.Forms
In Browse button click event,…
View On WordPress
0 notes
mattgrif · 5 years ago
Text
Pre-load awesome background images for Microsoft Teams Virtual Background using PowerShell Posted To Matt Blogs IT
New Post has been published on https://mattblogsit.com/microsoft/pre-load-awesome-background-images-for-microsoft-teams-virtual-background-using-powershell
Pre-load awesome background images for Microsoft Teams Virtual Background using PowerShell
Microsoft Teams officially rolled out Virtual Backgrounds back in March, around the time COVID-19 went crazy in the United States. With COVID-19 came a slew of people working from home, me included.
I spend a considerable chunk of my week on conference calls for work, volunteering, and honesty – just keeping up with friends. After a while, I had to spice up my virtual background with something new. The current implementation of Virtual Backgrounds in Microsoft Teams is limited in user-friendliness to add custom background images.
To add a custom background, you have to save the file to “%AppData%\Microsoft\Teams\Backgrounds\Uploads\” which isn’t bad once you know this. However, getting fresh background images is the problematic part. I love browsing Reddit and finding the beautiful pictures on EarthPorn or SpacePorn subreddits.
I’m a massive fan of automation, so I choose to play around with PowerShell and create a quick script. Luckily, I was able to snag the bulk of my code from u/uspeoples from a comment posted on the PowerShell subreddit.
All you need to do is change lines 2 and 4 to match your preference and run it. The script will automatically throw the images returned from Reddit into the correct directory.
#I also recommend SpacePorn, but any reddits will work. $subReddit = "EarthPorn" #You can use hot, new, or top for the filter $redditFilter = "top" #Don't change anything below this line $teamsDirectory = "$env:AppData\Microsoft\Teams\Backgrounds\Uploads\" $redditData = (invoke-restmethod "http://www.reddit.com/r/$subReddit/$redditFilter/.json").data.children.data.url foreach($data in $redditData) Invoke-WebRequest -Uri $data -OutFile ($teamsDirectory + $data.split('/')[-1])
Now, one major caveat when running this, Reddit won’t always have the best pictures; as my girlfriend put it, “They will also get ugly pictures, and it’ll flood their Teams.” With that said, I promised her I would let my readers know that they can navigate to “%AppData%\Microsoft\Teams\Backgrounds\Uploads\” and delete any that they do not like.
0 notes