https://4sysops.com/archives/use-powershell-to-execute-an-exe/

https://stackoverflow.com/questions/714877/setting-windows-powershell-path-variable#

临时添加

If, some time during a PowerShell session, you need to modify the PATH environment variable temporarily, you can do it this way:

  1. $env:Path += ";C:\Program Files\GnuWin32\bin"

每次启动powershell的时候,自动添加

Changing the actual environment variables can be done by using the env: namespace / driveinformation. For example, this code will update the path environment variable:

  1. $env:Path = "SomeRandomPath";

There are ways to make environment settings permanent, but if you are only using them from PowerShell, it's probably a lot better to use your profile to initiate the settings. On startup, PowerShell will run any .ps1 files it finds in the WindowsPowerShell directory under My Documents folder. Typically you have a profile.ps1 file already there. The path on my computer is

  1. c:\Users\JaredPar\Documents\WindowsPowerShell\profile.ps1

add environment path to powershell的更多相关文章

  1. Unable to write inside TEMP environment path

    安装PostgreSQL 9:Unable to write inside TEMP environment path 注册表:regedit HKEY_CLASSES_ROOT\.vbs,设置默认为 ...

  2. Import user's Environment path into Linux cron task

    How to use "cron" to create scheduled task Minimum time cycle: 1 minute Use crontab -e edi ...

  3. add a path cgi-bin to asp.net mvc

    1.简单,但是会丢失请求数据 protected void Application_BeginRequest() { string url = HttpContext.Current.Request. ...

  4. 安装postgresql碰到Unable to write inside TEMP environment path

    搞了半天,原来是 AVAST搞的鬼,把原来注册表的键值改成它自己了.其实应该是 C:\Windows\System32\vbscript.dll The answer in the following ...

  5. powershell里添加对git的支持

    在powershell命令行里依次运行 1. (new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1 ...

  6. XenDesktop 5 PowerShell SDK Primer – Part 2 – Creating Hypervisor Connections and Hosts

    One of the new changes that you will see in XenDesktop 5 is the configuration of hypervisor connecti ...

  7. windows cannot find powershell.exe windows 7

    This can happen when the environment variables are missing an entry for Powershell. $env:path must i ...

  8. Initializing a Build Environment

    This section describes how to set up your local work environment to build the Android source files. ...

  9. Powershell调用静态方法

    Powershell将信息存储在对象中,每个对象都会有一个具体的类型,简单的文本会以System.String类型存储,日期会以System.DateTime类型存储.任何.NET对象都可以通过Get ...

随机推荐

  1. UI进阶 即时通讯之XMPP环境搭建

    内容中包含 base64string 图片造成字符过多,拒绝显示

  2. python mock模块使用(二)

    本篇继续介绍mock里面另一种实现方式,patch装饰器的使用,patch() 作为函数装饰器,为您创建模拟并将其传递到装饰函数 官方文档地址 patch简介 1.unittest.mock.patc ...

  3. zoj 2812

    Quicksum Time Limit: 2 Seconds      Memory Limit: 65536 KB A checksum is an algorithm that scans a p ...

  4. CentOS7中,vnc分辨率设置。

    使用geometry参数进行调整 例如,我们需要将分辨率调整到800x600 [root@secdb ~]# vncserver -geometry 800x600 New 'secdb:5 (roo ...

  5. bzoj3572[Hnoi2014] 世界树 虚树+dp+倍增

    [Hnoi2014]世界树 Time Limit: 20 Sec  Memory Limit: 512 MBSubmit: 1921  Solved: 1019[Submit][Status][Dis ...

  6. 【BZOJ1008】越狱(排列组合计数,容斥原理)

    题意: 思路: #include<cstdio> #include<cstdlib> #include<iostream> #include<algorith ...

  7. BZOJ3926 (后缀自动机)

    BZOJ3926 诸神眷顾的幻想乡 Problem : 给一个n个节点的树(n<=10^5), 每个点有一种颜色(c<=10), 询问所有点对之间路径组成字符串的种类.保证叶子节点小于等于 ...

  8. HDU 1896 【留个使用priority_queue容器的样例】

    感谢<啊哈!算法>的讲解,水鸟弄懂了什么是优先队列. 题意是:在路上有很多石子,给出他们的初始位置和小明能够将他们扔出的距离,当小明遇到奇数个石子的时候就会把它扔出,遇到偶数个就会忽略他, ...

  9. DNS的工作原理及解析

    DNS协议是互联网核心协议之一.不管是上网浏览,还是编程开发,都需要了解一点它的知识. 一.什么是DNS? DNS( Domain Name System)是“域名系统”的英文缩写,是一种组织成域层次 ...

  10. POJ2573 Bridge 经典的过桥问题

    曾经遇到过类似的.纪念一下!这题同一时候也是  ZOJ1877.经典的过桥问题 是有个博客解说的非常好的 戳这里 挺久曾经.遇到过一个基本一样的,那个题目仅仅要求求出 最短时间就可以,如今还有过桥的过 ...