Linked Questions
20 questions linked to/from Any way to double-click on .PS1 file & open them in PowerShell?
1
vote
1
answer
3k
views
.ps1 script dont run at double click [duplicate]
i have a script to run and he works fine when i use that on PowerShell ISE, but i need to run at .ps1 file (double clicking) and when i try this, hothing happen... the powershell's window opens but my ...
0
votes
0
answers
47
views
Powershell script executes correctly when I choose "run with powershell", but not when I "open with" powershell or double-click it [duplicate]
I have written a very simple PowerShell script called "open backup.ps1". It just goes:
start ms-settings:backup
When I run it from the Powershell ISE or choose "Run with PowerShell"...
138
votes
4
answers
297k
views
Using UTF-8 Encoding (CHCP 65001) in Command Prompt / Windows Powershell (Windows 10)
I've been forcing the usage of chcp 65001 in Command Prompt and Windows Powershell for some time now, but judging by Q&A posts on SO and several other communities it seems like a dangerous and ...
10
votes
1
answer
39k
views
Running a powershell command using full path and arguments from command line [duplicate]
I have a script that sits in Program Files folder and accepts arguments: verbose and restart
Running it from its folder works perfectly:
powershell ./<file.ps1> -verbose:$True -restart
Trying ...
2
votes
2
answers
6k
views
Powershell -- how to minimize the console the script is running in while sitting in a loop?
I have a powershell script that is in my startup:
%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\
Note, the script itself is not in startup. Rather in \Startup\ is a shortcut to the script. ...
3
votes
1
answer
8k
views
Powershell Script only opens as a .txt file when run
Hi I have a script on a memory stick that I want to be able to run in cmd line before a computer has windows fully installed. (the stage just after you've connected to a network).
Cmd used to run the ...
1
vote
1
answer
5k
views
Change target of shortcut created in Powershell
I've got a script that installs a certain BP Program called iLink (Crosslink). The Script works fine and installs Java 6.21 and both Crosslink Components and also installs through DISM .Net 3.5 ...
4
votes
2
answers
3k
views
"Run with PowerShell" gives execution policy error but running directly in PowerShell window does not
I have a simple .ps1 script that basically just creates a directory. When I right-click on the script in Windows Explorer and select "Run with PowerShell", it gives the following error ...
1
vote
1
answer
1k
views
The PowerShell code works when run from the PowerShell command prompt but not when run with double-click or turned into an executable
This code:
$username = 'Username'
$password = 'Password'
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential $...
1
vote
2
answers
963
views
Run PowerShell command(s) outside of PowerShell
I have this simple PowerShell script:
Copy-Item -path ('\\PC1\Images\' + (Get-ChildItem -Path '\\PC1\Images' -Attributes !Directory *.dat | Sort-Object -Descending -Property LastWriteTime | Select-...
1
vote
2
answers
716
views
Get proper startup directory in PowerShell when executed via a shortcut file
I have a shortcut file that points to a PowerShell script file that is located in a different directory, and when that PowerShell script is executed via the shortcut file I require to obtain the ...
0
votes
0
answers
1k
views
Executing powershell script from Onenote
I'm using onenote as a documentation tool for some trivial tests and I sometimes use scripts.
I was using aside multiple scripts for automating stuff.
I would like to include these scripts in ...
1
vote
2
answers
443
views
PowerShell removes multiple consecutive whitespaces when I pass arguments to a nested Start-Process command
This powershell code works fine:
powershell -NoProfile -Command {Start-Process -FilePath wscript.exe -Verb RunAs -ArgumentList '"C:\Users\TestAccount\Desktop\cartella con spazi\test.vbs" &...
1
vote
1
answer
629
views
Windows double click not executing correct Powershell Script
In my directory I have a file called "t1.ps1" and a second file called "t1 - something.ps1".
Both of them run fine when run fine, when executed via right click run with PowerShell ...
1
vote
1
answer
298
views
Can Powershell process code in a BAT file?
I want to place PowerShell code in a BAT File and start the BAT file from the Windows explorer by double-click. Powershell shall execute BAT as PowerShell script. The intention is show in this example ...