Windows 10: Powershell modify/change variables in non-modal form

Discus and support Powershell modify/change variables in non-modal form in Windows 10 Software and Apps to solve the problem; Is there a way to change variables in non-modal form? like below, how to make change to $b.Text after start-job $function:goForm executed? Thanks.... Discussion in 'Windows 10 Software and Apps' started by Ian3, Jun 1, 2022.

  1. Ian3 Win User

    Powershell modify/change variables in non-modal form


    Is there a way to change variables in non-modal form? like below, how to make change to $b.Text after start-job $function:goForm executed? Thanks. Function Update_Al { $b.Text = 'Update 2' $b1.Text = $b.Text } $b = [pscustomobject]@{ Text = 'Update 1' } [void][reflection.assembly]::LoadWithPartialName"System.Windows.Forms" $form = new-object Windows.Forms.Form $form.Width =&nb

    :)
     
    Ian3, Jun 1, 2022
    #1
  2. AndreyT Win User

    How do I change environment variables in regular User account???


    SETX is a nice workaround. Unfortunately it's a bit limited: it cannot delete environment variables.

    Microsoft itself suggested PowerShell as a workaround

    Windows PowerShell Tip: Creating and Modifying Environment Variables
     
    AndreyT, Jun 1, 2022
    #2
  3. Kapil Arya MVP, Jun 1, 2022
    #3
  4. user28496 Win User

    Powershell modify/change variables in non-modal form

    Windows 10 System environment variables don't stick

    I am unable to update my system environment variable PATH. I don't receive any error message when editing PATH, but the change doesn't take. I have Windows 10. I am an admin user. Here are the steps I take to edit PATH.

    1. I Search for and open "View advanced system settings".
    2. Click the "Environment Variables" button.
    3. Locate "Path" under the System variables section. Click to highlight it.
    4. Click "Edit". The "Edit environment variable" modal window pops up.
    5. There are lots of paths listed in the listbox. Click New to add a new item.
    6. A blank space for the new folder is highlighted in the listbox. Click Browse. Select a folder. Click OK. The browsed path is in the listbox.
    7. Click "OK" on the Edit environment variable modal.
    8. Close all existing cmd windows if any are open. Open a new cmd window.
    9. type echo %PATH%

    I expect my added PATH to be shown, but it is not. If I repeat the steps above, my newly added folder is not in the listbox on the "Edit environment variable" model when I click to edit the PATH system environment variable the second time. I also expected Windows to prompt me for elevated admin privileges at some point when editing the environment variable, but this never happens. What am I doing wrong?
     
    user28496, Jun 1, 2022
    #4
Thema:

Powershell modify/change variables in non-modal form

Loading...
  1. Powershell modify/change variables in non-modal form - Similar Threads - Powershell modify change

  2. Powershell breaks with semicolons in the PATH environment variable

    in Windows 10 Gaming
    Powershell breaks with semicolons in the PATH environment variable: I've been going down a rabbit hole with how Powershell processes the PATH environment variable. I am developing a program that helps manage the PATH, and I recently discovered that it has issues when a path containing semicolons is added to the PATH.According to [this comment...
  3. Powershell breaks with semicolons in the PATH environment variable

    in Windows 10 Software and Apps
    Powershell breaks with semicolons in the PATH environment variable: I've been going down a rabbit hole with how Powershell processes the PATH environment variable. I am developing a program that helps manage the PATH, and I recently discovered that it has issues when a path containing semicolons is added to the PATH.According to [this comment...
  4. Powershell breaks with semicolons in the PATH environment variable

    in Windows 10 Network and Sharing
    Powershell breaks with semicolons in the PATH environment variable: I've been going down a rabbit hole with how Powershell processes the PATH environment variable. I am developing a program that helps manage the PATH, and I recently discovered that it has issues when a path containing semicolons is added to the PATH.According to [this comment...
  5. Non-Modal Window Optimization

    in Windows 10 Gaming
    Non-Modal Window Optimization: Hi,I just found that the non-modal window are styled differently than others in Windows 11,here it is:RegularNon-ModalThe red button on the non-modal window seems out of place, and the positions of the icons are rather random, looking like a bug....
  6. Non-Modal Window Optimization

    in Windows 10 Software and Apps
    Non-Modal Window Optimization: Hi,I just found that the non-modal window are styled differently than others in Windows 11,here it is:RegularNon-ModalThe red button on the non-modal window seems out of place, and the positions of the icons are rather random, looking like a bug....
  7. Changes of PATH Variable

    in Windows 10 Gaming
    Changes of PATH Variable: Hello there,I changed the PATH Variable and added another directory to implement the given commands under DOS.The strange thing is, that this works fine as Administrator and absolutely not, when logged in with a non-administrator account.What do I do wrong?Kind regards...
  8. Powershell modify/change variables in non-modal form

    in Windows 10 Gaming
    Powershell modify/change variables in non-modal form: Is there a way to change variables in non-modal form? like below, how to make change to $b.Text after start-job $function:goForm executed? Thanks. Function Update_Al { $b.Text = 'Update 2' $b1.Text = $b.Text } $b = [pscustomobject]@{ Text = 'Update 1' }...
  9. Modify System Environmental Variables

    in Windows 10 Customization
    Modify System Environmental Variables: Dear staff! I need to modify the System Environmental Variables specifically the PATH variable from my local user already set as administrator but these options are still greyed out for me, in order to setup Android Studio together with Flutter component. I already tried this...
  10. non elevated powershell?

    in AntiVirus, Firewalls and System Security
    non elevated powershell?: Hi, I read that I can uninstall apps via the powershell elevated, and I indeed did this. But what surprised me was that even a non-elevated powershell prompt allowed me to uninstall a number of apps as well. Would this mean that I can even reinstall apps via a...