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:

$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:

$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

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. Leetcode 309.最佳买卖股票时机含冷冻期

    最佳买卖股票时机含冷冻期 给定一个整数数组,其中第 i 个元素代表了第 i 天的股票价格.​ 设计一个算法计算出最大利润.在满足以下约束条件下,你可以尽可能地完成更多的交易(多次买卖一支股票): 你不 ...

  2. zoj 2835 Magic Square(set)

    Magic Square Time Limit: 2 Seconds      Memory Limit: 65536 KB In recreational mathematics, a magic ...

  3. iOS第三方语音-微信语音

    网址链接:http://pr.weixin.qq.com/ 里面包含了微信语音和图像,集成很简单,下载方demo后会有个文档,按照流程来(因为它只提供了真机的.a文件,所以只能用真机哦,不然会报错) ...

  4. HDU 4597

    题目大意: 两人轮流从两堆牌从抽取最顶端或者最底部的牌,得到的分数加到自己身上,问先拿牌的最多能得多少分 记忆化搜索,2堆牌的底和顶,有四种方法,根据四种方法来找到最优解 #include <c ...

  5. hihoCoder#1196 : 高斯消元·二(开关灯问题)

    传送门 高斯消元解异或方程组 小Ho在游戏板上忙碌了30分钟,任然没有办法完成,于是他只好求助于小Hi. 小Ho:小Hi,这次又该怎么办呢? 小Hi:让我们来分析一下吧. 首先对于每一个格子的状态,可 ...

  6. hdu4405:Aeroplane chess

    题目大意:有编号为0-n的格子,从0开始,扔骰子扔到几就走几格.有m个瞬移点,每个点可以从格x直接飞到格y,若瞬移到另一个瞬移点可以继续瞬移.求到达格n的期望扔骰子次数. 题解:期望DP入门好题.网上 ...

  7. Notification通知创建

    Notification通知创建 由于通知是一个远程视图,所以创建通知在状态栏显示需要用到三个主要的对象: 一.PendingIntent对象,用来承载Intent对象的,Intent对象主要是定义通 ...

  8. poj2723 2sat判断解+二分

    典型的2-sat问题,题意:有m个门,每个门上俩把锁,开启其中一把即可,现在给n对钥匙(所有 钥匙编号0123456...2n-1),每对钥匙只能用一把,要求尽可能开门多(按顺序,前max个). 关键 ...

  9. Apache 文件根目录设置修改方法 (Document Root)

    最近在学习WordPress,使用appServ 在windows上搭建Php开发环境 在网上查找到的关于修改Apache服务器根目录的资料,对比学习,再此记录 在安装 Apache 时,系统会给定一 ...

  10. Educational Codeforces Round 37 (Rated for Div. 2) G

    G. List Of Integers time limit per test 5 seconds memory limit per test 256 megabytes input standard ...