Windows 10: Run desktop script in PowerShell

Discus and support Run desktop script in PowerShell in Windows 10 Network and Sharing to solve the problem; I have a script on my desktop that I need to run in PowerShell; how do I do that?... Discussion in 'Windows 10 Network and Sharing' started by RogerBlair1, Jun 3, 2023.

  1. Run desktop script in PowerShell


    I have a script on my desktop that I need to run in PowerShell; how do I do that?

    :)
     
    RogerBlair1, Jun 3, 2023
    #1
  2. Studynxx Win User

    Powershell / Batch scripts do NOT run!

    Please help me. I have written some powershell and batch scripts, yet when I run those files, they don't run. At most the powershell script just does step #1 but not all the other steps (lines of code / instructions). The batch script .bat file doesn't do anything. Both just pop up for like 2 seconds and then they disappear, Task Manager says nothing's being done.
     
    Studynxx, Jun 3, 2023
    #2
  3. EckiS Win User
    PowerShell script run - Cmdlets

    As SQL-IP and Cosmos are still internal to Microsoft, I wonder why you are not simply contacting the person who provided you with the scripts.

    For point 1: see PowerShell: Bypass ExecutionPolicy to run downloaded scripts

    For point2: this is specific to the script: "Cosmos.Document" is probably in a module which is not found.
     
    EckiS, Jun 3, 2023
    #3
  4. Run desktop script in PowerShell

    PowerShell script run - Cmdlets

    Greetings - in the last month my role (support for Microsoft) has begun running database searches using PowerShell ISE - the procedure and software I was given by Microsoft to follow specified PowerShell ISE, not PowerShell. The first week or so the searches
    seemed to run fine and I got good results returned. Then the searches stopped successfully executing. I got various error messages, or just illogical results, and so I tried reinstalling PowerShell a couple of times, with no success. On Friday 8/12 I upgraded
    to Win10 Anniversary Ed. I still can't successfully run a PowerShell ISE search request. So, I'm hoping the Forum can help:

    1. When I Run a request I get this pop-up: "Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unbock-File cmdlet to allow the script to run without
    this warning message. Do you want to run ...". I then get 3 options 1) Do not run, 2) Run Once, 3) Suspend.

    My understanding is that the "Unbock-File cmdlet" is a single-feature command that manipulates objects in Windows PowerShell. Where should I insert the "Unbock-File cmdlet" ? I trust the script because it was provided to me by Microsoft.

    2. I've been selecting option 2) Run Once. The script will then run for a while, and then I get this error message "[Expression Error] The import Cosmos.Document matches no exports. Did you miss a module reference?"

    How do resolve this issue? Reinstalling PowerShell has not seemed to help.

    Any help much appreciated!
     
    Jacqui Schultz, Jun 3, 2023
    #4
Thema:

Run desktop script in PowerShell

Loading...
  1. Run desktop script in PowerShell - Similar Threads - Run desktop script

  2. Cannot get PowerShell script to run

    in Windows 10 Gaming
    Cannot get PowerShell script to run: Hi,No matter what I try I cannot get permission to run a .ps1 file. I always get this error:& : File C:\Program Files\putty\pagentpass.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at...
  3. Cannot get PowerShell script to run

    in Windows 10 Software and Apps
    Cannot get PowerShell script to run: Hi,No matter what I try I cannot get permission to run a .ps1 file. I always get this error:& : File C:\Program Files\putty\pagentpass.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at...
  4. Run desktop script in PowerShell

    in Windows 10 Gaming
    Run desktop script in PowerShell: I have a script on my desktop that I need to run in PowerShell; how do I do that? https://answers.microsoft.com/en-us/windows/forum/all/run-desktop-script-in-powershell/666a7726-8cbd-42c7-ac2c-419229432252
  5. Run desktop script in PowerShell

    in Windows 10 Software and Apps
    Run desktop script in PowerShell: I have a script on my desktop that I need to run in PowerShell; how do I do that? https://answers.microsoft.com/en-us/windows/forum/all/run-desktop-script-in-powershell/666a7726-8cbd-42c7-ac2c-419229432252
  6. PowerShell script

    in Windows 10 Support
    PowerShell script: The code below tests a series of IPs in a txt file.The result is as follows and is written in a txt file. 19.191.12.161 - online 19.191.12.162 - offline 19.191.12.163 - offline 19.191.12.164 - offline 19.191.12.165 - offline also see the scrennshot Code: $Output= @()$GetIP =...
  7. powershell script

    in Windows 10 Customization
    powershell script: looking for a script to monitor for a folder, if there is a file in that folder send it as an email, once the email is sent out, confirm and then move the files to an archive folder. monitor c:\test\*.pdf No files, do not send email. Yes Files, send an email to someone at...
  8. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    Running PowerShell script as a batch file: Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing bloatware***...
  9. Run PowerShell Script As An Administrator

    in Windows 10 Support
    Run PowerShell Script As An Administrator: Hi. So I've been searching online on a way to do this yet I cannot find a way to do it. _______________________________________ I need this in specific: I want to double click a PowerShell script file (which will run as an administrator) from Windows Explorer that has...
  10. PowerShell Scripting - Run a Script from Shortcut

    in Windows 10 Tutorials
    PowerShell Scripting - Run a Script from Shortcut: How to: PowerShell Scripting - Run a Script from Shortcut [img] Information One of many PowerShell security features is that you can't run a script simply by double clicking it's icon on desktop or in a folder. Doing so will by default open script in Notepad for editing...