In many scenarios, we will get the requirement to upload the reports, tracker from one location to another location , so i decided to write this post to explain how to upload files like excel, txt… with the help of Powershell GUI. Instead of thinking high level, here i had split the three simple task to achieve the file upload functionality in the Powershell.

  1. 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
  2. In Browse button click event, you can perform the browse with the specific file that need to be upload to destination folder using New-Object -TypeName System.Windows.Forms.OpenFileDialog. These make the selection of files or folders easy for users and prevent mistakes being made in file paths.
  3. In upload button click event, you can perform the Move action on the selected file to place on Target location.

When designing PowerShell scripts, I have often found it useful to incorporate a file or folder dialogue to select files or folders. These make the selection of files or folders easy for users and prevent mistakes being made in file paths.

Example:

Output:

What do you think?

I hope you have an idea of  How To upload the files with help of PowerShell GUI. I would like to have feedback from my posts readers. Your valuable feedback, question, or comments about this article are always welcome.