Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Powershell, Execute file

views
     
TSUbuntuClient
post May 29 2025, 04:00 PM, updated 7 months ago

Regular
******
Senior Member
1,417 posts

Joined: Jun 2007
From: /puchong/cyberjaya/klang



Hi,

How to make batch script file so i can run from powershell with normal user?
CODE
# Make sure you're running [Powershell] as an Administrator.
Get-Service ssh-agent | Set-Service -StartupType Manual

# Start the service
Start-Service ssh-agent

# This should return a status of Running
Get-Service ssh-agent

# Now load your key files into ssh-agent
ssh-add "C:\Users\Tech Support\.ssh\id_rsa2.pub"


Now i run as manual and run as administrator.

Please advice.

Thanks.
TSUbuntuClient
post May 30 2025, 09:14 PM

Regular
******
Senior Member
1,417 posts

Joined: Jun 2007
From: /puchong/cyberjaya/klang



After google around, i have found the solution. It need change policy as describe in article below.
https://www.pdq.com/blog/writing-your-first...ershell-script/

The script need to be assign to run with powershell. You can use notepad ++ and save the file as .ps1. Then under file properties, choose run with administrator.

 

Change to:
| Lo-Fi Version
0.0127sec    0.98    6 queries    GZIP Disabled
Time is now: 17th December 2025 - 01:24 PM