下载文件

http://powershell.com/cs/blogs/tips/archive/2012/10/11/downloading-files-from-internet.aspx

PowerShell v3 comes with a hugely useful new cmdlet called Invoke-WebRequest. You can use it to interact with websites which also includes downloading files.

This will download the SysInternals suite of tools to your computer:

  1. $Source = 'http://download.sysinternals.com/files/SysinternalsSuite.zip'
  2. $Destination = "$env:temp\sysinternalssuite.zip"
  3. Invoke-WebRequest -uri $Source -OutFile $Destination
  4. Unblock-File $Destination

Since downloaded files are blocked by Windows, PowerShell v3 comes with yet another new cmdlet: Unblock-File removes the block. Now you're ready to unzip the file.

If your Internet connection requires proxy settings or authentication, take a look at the parameters supported by Invoke-WebRequest.

PowerShell 常用命令的更多相关文章

  1. Powershell常用命令

    Powershell常用命令1.Get-Command 得到Powshell所有命令2.Get-Process 获取所有进程3.Set-Alias 给指定命令重命名 如:Set-Alias aaa G ...

  2. PowerShell常用命令及美化(现代化的CMD)

    PowerShell可谓现代终端,是微软用来替代古老的CMD的. PowerShell拥有面向对象的思想,非常方便. 常用命令 下载文件(此处以install.ps1文件为例) $client = n ...

  3. bash 和 powershell 常用命令集锦

    Linux Shell # 1. 后台运行命令 nohup python xxx.py & # 查找替换 ## 只在目录中所有的 .py 和 .dart 文件中递归搜索字符"main ...

  4. cmd/powershell常用命令 git常用命令

    cmd/powershell: 1. 新建文件夹: mkdir directoryName 2. 新建文件: cmd: type nul>fileName (空文件) powershell: n ...

  5. powershell 常用命令之取磁盘分区信息

    //查看mac 地址 PS C:\Users\yyy> get-wmiobject -class Win32_NetworkAdapterConfiguration -namespace &qu ...

  6. Windows PowerShell基本语法及常用命令

    PowerShell常用命令: 一 Get类 1.Get-Command : 得到所有PowerShell命令,获取有关 cmdlet 以及有关 Windows PowerShell 命令的其他元素的 ...

  7. PowerShell常用的.Net 、COM对象(New-Object、Assembly)、加载程序集

    #新建随机数对象实例:$Ran = New-Object System.Random$Ran.NextDouble() 有时候,要使用的实例的类保存在独立的库文件中,PowerShell默认未加载,会 ...

  8. Windows运行常用命令(win+R)

    Windows运行常用命令(win+R) 1.calc: 启动计算器 2.notepad: 打开记事本 3.write: 写字板 4.mspaint: 画图板 5.snippingtool:截图工具, ...

  9. Windows下内网渗透常用命令总结

    域内信息收集常用命令 net group /domain //获得所有域用户组列表 net group zzh /domain //显示域中zzh组的成员 net group zzh /del /do ...

随机推荐

  1. Codeforces Round #207 (Div. 1) A. Knight Tournament(STL)

    脑子又卡了...来一发set的,STL真心不熟. #include <stdio.h> #include <string.h> #include <iostream> ...

  2. 整理iOS9适配

    整理iOS9适配 本文主要是说一些iOS9适配中出现的坑,如果只是要单纯的了解iOS9新特性可以看瞄神的开发者所需要知道的 iOS 9 SDK 新特性.9月17日凌晨,苹果给用户推送了iOS9正式版, ...

  3. 李洪强iOS经典面试题138-Block

    李洪强iOS经典面试题138-Block   Block Block底层原理实现 首先我们来看四个函数 void test1() { int a = 10; void (^block)() = ^{ ...

  4. [LintCode] Valid Palindrome 验证回文字符串

    Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignori ...

  5. [CareerCup] 16.4 A Lock Without Deadlocks 无死锁的锁

    16.4 Design a class which provides a lock only if there are no possible deadlocks. 有很多方法可以避免死锁的发生,一个 ...

  6. struts2中用xml配置文件去验证填写信息

    xml名字是这样的 actionName-validation.xml 每个action 对应一个xml文件 xml文件和action放在同一个包下 后台验证用户输入是否符合格式要求,不符合,提交后返 ...

  7. [转] - hadoop中使用lzo的压缩

    在hadoop中使用lzo的压缩算法可以减小数据的大小和数据的磁盘读写时间,不仅如此,lzo是基于block分块的,这样他就允许数据被分解成chunk,并行的被hadoop处理.这样的特点,就可以让l ...

  8. HDU3466 背包DP

    Proud Merchants Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) ...

  9. POJ 1016 模拟字符串

    Numbers That Count Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 20396   Accepted: 68 ...

  10. HDU1176

    免费馅饼 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submi ...