Search found 63 matches

by rmckay9969
Mon Feb 13, 2017 8:17 pm
Forum: PowerShell GUIs
Topic: Show_GUIForm from ps1 script without waiting for the GUIForm to close...
Replies: 1
Views: 750

Re: Show_GUIForm from ps1 script without waiting for the GUIForm to close...

You could launch your window using a runspace. [int]$Counter = 1 if($counter -lt 5000){ $counter++ Start-Sleep -Seconds 3 } $RunSpace = [RunSpaceFactory]::CreateRunSpace() #Create new runspace. $RunSpace.ApartmentState = 'STA' $RunSpace.ThreadOptions = 'UseNewThread' $RunSpace.Open() $Instance = [Po...
by rmckay9969
Wed Feb 08, 2017 10:32 pm
Forum: PowerShell GUIs
Topic: Window not closing
Replies: 15
Views: 2797

Re: Window not closing

While the resident bull was snarling and kicking up dust, I decided to make an example project of what I think the original question was asking. Brian I hope this example is something along the lines of what you were looking for. I will be washing my hands of this discussion now. More exactly - my ...
by rmckay9969
Wed Feb 08, 2017 9:23 pm
Forum: PowerShell GUIs
Topic: Window not closing
Replies: 15
Views: 2797

Re: Window not closing

DevinL wrote:Thanks for the example, rmckay!

I'll be keeping this one for future use.
None necessary, this forum has been a great resource for me. I just like to return the favor if at all possible.
by rmckay9969
Wed Feb 08, 2017 8:59 pm
Forum: PowerShell GUIs
Topic: Window not closing
Replies: 15
Views: 2797

Re: Window not closing

While the resident bull was snarling and kicking up dust, I decided to make an example project of what I think the original question was asking. Brian I hope this example is something along the lines of what you were looking for. I will be washing my hands of this discussion now.
by rmckay9969
Wed Feb 08, 2017 7:44 pm
Forum: PowerShell GUIs
Topic: Window not closing
Replies: 15
Views: 2797

Re: Window not closing

This has nothing to do with Sapien. It is how Windows works. Sapien, PowerShell Studio, and PowerShell can only use what Microsoft has designed. Since the very beginning of Windows (1985) this was part of the design. There is no direct way around this. If you don't like it speak to the Microsoft en...
by rmckay9969
Wed Feb 08, 2017 7:03 pm
Forum: PowerShell GUIs
Topic: Window not closing
Replies: 15
Views: 2797

Re: Window not closing

[System.Windows.Forms.Form]::ActiveForm.Visible = $false In the button click event that calls your new form, place this after the call to the new form is made. Should call the new form and then hide itself. Had to update my original post because I keep forgetting these are still modal forms... In a...
by rmckay9969
Wed Feb 08, 2017 6:06 pm
Forum: PowerShell GUIs
Topic: Window not closing
Replies: 15
Views: 2797

Re: Window not closing

Code: Select all

[System.Windows.Forms.Form]::ActiveForm.Visible = $false
In the button click event that calls your new form, place this after the call to the new form is made.
Should call the new form and then hide itself. Had to update my original post because I keep forgetting these are still modal forms...
by rmckay9969
Tue Jan 24, 2017 10:31 pm
Forum: PowerShell Studio
Topic: Possible Bug in PowerShell Studio 2017
Replies: 7
Views: 1961

Re: Possible Bug in PowerShell Studio 2017

Just wanted to post back here on that "workaround" that I thought i had found. The example I posted will work great if a portion of your program needs to call upon a .dll file. But it is not a solution for a exe.config file as after further testing the Powershell Studio .exe still wants the config f...
by rmckay9969
Wed Jan 18, 2017 6:26 pm
Forum: PowerShell Studio
Topic: Possible Bug in PowerShell Studio 2017
Replies: 7
Views: 1961

Re: Possible Bug in PowerShell Studio 2017

I just slung in a workaround to mask the problem. $ConFigPth = "$env:temp\DataEntry.exe.config" if (!(Test-Path $ConFigPth)) { $ConFig = [System.Convert]::FromBase64String($ConfigBase64) Set-Content -Path $env:temp\DataEntry.exe.config -Value $ConFig -Encoding Byte } Add-Type -Path $env:temp\DataEnt...
by rmckay9969
Wed Jan 18, 2017 2:03 pm
Forum: PowerShell Studio
Topic: Possible Bug in PowerShell Studio 2017
Replies: 7
Views: 1961

Re: Possible Bug in PowerShell Studio 2017

The problem is that I have invested many hours building a fairly complex program as a portable standalone executable requiring no external files for operation and now I will be required to include what I've tried so hard to prevent. Config files seem like a tacked on and very sloppy approach to me.