Here is the fast way to get the PsDrive
Get-PsDrive "$([System.Windows.Forms.Application]::ExecutablePath[0])"
The following is teh easy way to get the root:
(Get-PsDrive "$([System.Windows.Forms.Application]::ExecutablePath[0])").Root
Search found 14746 matches
- Fri Apr 09, 2021 2:31 am
- Forum: PowerShell
- Topic: Force PStudio EXE to run from specified location only
- Replies: 10
- Views: 665
- Fri Apr 09, 2021 2:23 am
- Forum: PowerShell
- Topic: Force PStudio EXE to run from specified location only
- Replies: 10
- Views: 665
Re: Force PStudio EXE to run from specified location only
The current standard method for accessing an executable on a UNC path is to not use a mapped drive. Just specify the UNC path in the shortcut and deploy the shortcut to the “public Desktop” or to the users private desktop. This method is always best and prevents the issues you are having. In modern ...
- Thu Apr 08, 2021 6:02 pm
- Forum: PowerShell GUIs
- Topic: recover click event of checkbox
- Replies: 2
- Views: 418
Re: recover click event of checkbox
You cannot update a non-glbal variable in a function or event directly. The variable besing accessed is out of scope. Why would you use two checkboxes to swap and unswap two strings. You can just use on box and check if it is checked. if($CheckBox1ADCreaDisplayName.Checked){ $textbox.Text = $GivenNa...
- Thu Apr 08, 2021 11:13 am
- Forum: PowerShell
- Topic: Force PStudio EXE to run from specified location only
- Replies: 10
- Views: 665
Re: Force PStudio EXE to run from specified location only
Actually your question is a bit ambiguous. Are you asking about the PowerShell Studio application or any application?
To easily find the executable of any application use the following.
[System.Windows.Forms.Application]::ExecutablePath
To easily find the executable of any application use the following.
[System.Windows.Forms.Application]::ExecutablePath
- Thu Apr 08, 2021 11:00 am
- Forum: PowerShell
- Topic: Force PStudio EXE to run from specified location only
- Replies: 10
- Views: 665
Re: Force PStudio EXE to run from specified location only
You have the PWD so just use that to get the drive.
- Thu Apr 08, 2021 4:41 am
- Forum: PowerShell
- Topic: Force PStudio EXE to run from specified location only
- Replies: 10
- Views: 665
Re: Force PStudio EXE to run from specified location only
Use Get-PsDrive
- Wed Apr 07, 2021 3:53 am
- Forum: PowerShell GUIs
- Topic: Apply filter to all columns on a Data Table?
- Replies: 4
- Views: 221
Re: Apply filter to all columns on a Data Table?
It's possible. Just write the filter code.
- Wed Apr 07, 2021 2:00 am
- Forum: PowerShell GUIs
- Topic: Print results into a textbox in reverse order
- Replies: 3
- Views: 262
Re: Print results into a textbox in reverse order
Sorry - typo. SHould be
$textbox.Text = $newline + $textbox.Text
For ListBox just insert the line at index 0.
$listbox.Items.Insert(0,$line)
$textbox.Text = $newline + $textbox.Text
For ListBox just insert the line at index 0.
$listbox.Items.Insert(0,$line)
- Tue Apr 06, 2021 6:23 pm
- Forum: PowerShell GUIs
- Topic: Cannot close form with $FormName.Close()
- Replies: 9
- Views: 480
Re: Cannot close form with $FormName.Close()
No. It reminded me to look before I leap. Luckily my machine recovers to exactly the point of the crash and all apps come open and back where they were although the restart is very slow. It is a good way to have a development machine behave since crashes can be quite normal although a VM is a better...
- Tue Apr 06, 2021 3:40 pm
- Forum: PowerShell GUIs
- Topic: Print results into a textbox in reverse order
- Replies: 3
- Views: 262
Re: Print results into a textbox in reverse order
There is no reverse order for an array. You can create a new array in reverse then assign it to the "Lines" property.
To insert lines in a list use a ListBox as inserts can be done at the top.
You can also do this.
$listbox.Text = $newline + $listbox.Text
To insert lines in a list use a ListBox as inserts can be done at the top.
You can also do this.
$listbox.Text = $newline + $listbox.Text