Search found 451 matches

by stevens
Fri Apr 24, 2020 7:33 am
Forum: PowerShell GUIs
Topic: Run a PSscript with other credentials, capture the output/debug as admin?
Replies: 5
Views: 1285

Re: Run a PSscript with other credentials, capture the output/debug as admin?

Thanks for the input. I had a typo, will get back with details later on to finetune if needed.
by stevens
Fri Apr 24, 2020 6:49 am
Forum: PowerShell GUIs
Topic: Buildversion, use exeversion to show in GUI?
Replies: 8
Views: 3271

Re: Buildversion, use exeversion to show in GUI?

It worked fine, but it appears my GUI throws errors on that code all the time. When running the GUI via console, I see errors all the time which makes that my gui takes up to a minute to load :-( l\Globals.ps1:330 char:29 + $RuntimeFileInfo = Get-Item $hostinvocation.MyCommand.path + ~~~~~~~~~~~~~~~...
by stevens
Fri Apr 24, 2020 3:59 am
Forum: PowerShell GUIs
Topic: Running project takes 1 minute
Replies: 16
Views: 3197

Re: Running project takes 1 minute

See https://www.sapien.com/forums/viewtopic.php?f=21&t=14566 The code Nillth provided is exactly what I am using $RuntimeFileInfo = Get-Item $hostinvocation.MyCommand.path $RuntimeVersion = $($RuntimeFileInfo.VersionInfo.ProductVersion) As mentioned, it works fine, the $RunTime version shows correct...
by stevens
Fri Apr 24, 2020 2:11 am
Forum: PowerShell GUIs
Topic: Running project takes 1 minute
Replies: 16
Views: 3197

Re: Running project takes 1 minute

Thanks. When I look back in the posts I don't see it. I'm probably overlooking it then. --- Now I know why the GUI loads slow. It is new code that was suggested on this forum. I'm using $form.text = "Running $RuntimeVersion" which is showing the version fine in the GUI. I get the $RuntimeVersion fro...
by stevens
Fri Apr 24, 2020 1:09 am
Forum: PowerShell GUIs
Topic: Running project takes 1 minute
Replies: 16
Views: 3197

Re: Running project takes 1 minute

If anybody would have told me that I can run the project "in console" I would have found what is going on. There are so many features, just didn't see that one. Now I can easily see when a form doesn't startup what blocks it (was another post of me). Actually that just happened, then noticed that op...
by stevens
Thu Apr 23, 2020 1:56 pm
Forum: PowerShell GUIs
Topic: Run a PSscript with other credentials, capture the output/debug as admin?
Replies: 5
Views: 1285

Re: Run a PSscript with other credentials, capture the output/debug as admin?

Thanks, I will certainly look at it. But my command is working as is, so would first like to make it work in the GUI, then adapt/finetune. It works outside the GUI, but within the GUI I get this as a result :-( >> Start-Process powershell.exe -ArgumentList "$ToExecute" -Credential $AdminCredentials ...
by stevens
Thu Apr 23, 2020 1:43 pm
Forum: PowerShell GUIs
Topic: Running project takes 1 minute
Replies: 16
Views: 3197

Re: Running project takes 1 minute

Thanks for your feedback. It is indeed the project itself. Another project does not have any problem. Though the problem appeared one day out of the blue and I have no clue why, reverted some changes but didn't help. I also have no indication where to look for :-( So I'm building it each time I want...
by stevens
Thu Apr 23, 2020 8:05 am
Forum: PowerShell GUIs
Topic: Run a PSscript with other credentials, capture the output/debug as admin?
Replies: 5
Views: 1285

Run a PSscript with other credentials, capture the output/debug as admin?

Hi, I have a powershell script that I run from a share and which is ran by another user. It run Start-Process powershell.exe -ArgumentList -NoProfile -WindowStyle Normal -executionpolicy bypass -noninteractive \\pathtomyscript\script -optionsofscript -credential AdminCredentials That works fine. How...
by stevens
Thu Apr 23, 2020 7:08 am
Forum: PowerShell GUIs
Topic: ConvertDataset for GridView 'Invalid storage type: DBNull.'
Replies: 23
Views: 5351

Re: ConvertDataset for GridView 'Invalid storage type: DBNull.'

Thanks, that works indeed in general, but not in my case.
Guess I have something wrong somewhere, but everything looks fine.