-
Oct 13th, 2020, 04:33 PM
#1
Thread Starter
Lively Member
running powershell through vb.net
Hi! I'm having quite a bit of trouble running powershell scripts through vb.net. Here's what I have so far:
Code:
Dim psi As New ProcessStartInfo() ' initialize processstartinfo (psi)
psi.Verb = "runas" ' runas = run as administrator
psi.FileName = ("powershell.exe")
psi.Arguments = "/c ""C:\mountiso.ps1"""
I've worked out the whole security issue that is inherent with windows 10 so that's not the issue.
I'm hoping the solution is easier than the problem.
-
Oct 13th, 2020, 04:39 PM
#2
Re: running powershell through vb.net
-
Oct 13th, 2020, 05:03 PM
#3
Thread Starter
Lively Member
Re: running powershell through vb.net
would you believe but I already came across that but to be honest it's a bit above my head, i was hoping for something a little more newbie friendly.
-
Oct 13th, 2020, 05:09 PM
#4
Thread Starter
Lively Member
Re: running powershell through vb.net
When I copy and paste your solution i get the following error:
Attachment 179002
Can you help me out?
-
Oct 13th, 2020, 05:11 PM
#5
Thread Starter
Lively Member
Re: running powershell through vb.net
Never mind i figured it out! I'm still getting error messages but I'll figure them out!
-
Oct 13th, 2020, 05:16 PM
#6
Thread Starter
Lively Member
Re: running powershell through vb.net
OK now I'm getting a security issue:
Code:
Errors:
-------
C:\mountiso.ps1 : File C:\mountiso.ps1 cannot be loaded because running scripts is disabled on this system. For more
information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
-
Oct 13th, 2020, 05:17 PM
#7
Thread Starter
Lively Member
Re: running powershell through vb.net
I know this command sorts this error:
Code:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
but how do i issue the command?
-
Oct 13th, 2020, 05:43 PM
#8
Re: running powershell through vb.net
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|