Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8343095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:57:26+00:00 2026-06-09T05:57:26+00:00

I have a simple powershell script to enable a mailbox in Exchange called test.ps1.

  • 0

I have a simple powershell script to enable a mailbox in Exchange called test.ps1. Here is the script:

add-pssnapin microsoft.exchange.management.powershell.admin
Enable-Mailbox -Identity ‘gi joe’ -database ‘myserver\myserver mailbox database 17’

If I go to the Powershell console and type

./test.ps1

It will run successfully. However, if I call it in VB.net using

Process.Start(“powershell”, “test.ps1”)

the terminal flashes too quickly for me to see what it says, and it doesn’t create the mailbox. Why does this happen, or how can I stop the terminal from disappearing before I can read the error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T05:57:27+00:00Added an answer on June 9, 2026 at 5:57 am

    To see what is going wrong try this instead:

    Process.Start("powershell", "-noexit -file c:\<path>\test.ps1")
    

    I suspect the error you get is because you aren’t providing a full path to test.ps1.

    Another possibility is that your 32-bit VB app needs to launch 64-bit Powershell (snapin or module may only be available there). In that case you need to invoke PowerShell by path and you have to use SysNative in your path to be able to see the 64-bit PowerShell dir.

    var powerShellPath = "C:\Windows\SysNative\WindowsPowerShell\v1.0\powershell.exe"
    Process.Start(powerShellPath , "-noexit -file c:\<path>\test.ps1")
    

    Sorry that’s probably not proper VB syntax but should get you going.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple Powershell v1.0 script to kill processes by name: $target
i have a simple powershell script, like this sqlcmd -S. -E -Q 'select ''$(x)'''
I am a newbie in powershell. I have a simple powershell script that just
I have a fairly simple Psake build script (default.ps1) that calls Invoke-Psake from within
I have a simple powershell script that gets ran daily to compress and move
I have a batch file test.bat to start a powershell script: @pushd C:\myscripts powershell
I have a simple PowerShell script to stop a process: $p = get-process $args
I am struggling to get this simple PowerShell script to work. I have googled,
I have a simple PowerShell script that uses WMI to create a web site
I have a couple of powershell command that are very simple. disable-mailbox dadelgad -confirm:$false

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.