• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >PowerShell > PowerShell中查看当前版本、Windows版本、.NET版本信息的代码

PowerShell中查看当前版本、Windows版本、.NET版本信息的代码

作者:mdxy-dxy 字体:[增加 减小] 来源:互联网

mdxy-dxy 通过本文主要向大家介绍了windows powershell,windows10 powershell,windows7 powershell,windowspowershell2.0,windows powershell64等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

PowerShell查看当前版本、Windows版本、.NET版本信息

有很多cmdlet或者cmdlet的参数,在PowerShell不同的版本中,支持得不一样。所以,弄清楚当前PowerShell的版本信息是非常重要的一件事情。那么怎么查看当前PowerShell的版本信息呢?洪哥向大家介绍两个方法:

其实就是两个PowerShell的环境变量,一个是$psversiontable,另一个是$host。

有很多cmdlet或者cmdlet的参数,在PowerShell不同的版本中,支持得不一样。所以,弄清楚当前PowerShell的版本信息是非常重要的一件事情。那么怎么查看当前PowerShell的版本信息呢?洪哥向大家介绍两个方法:

其实就是两个PowerShell的环境变量,一个是$psversiontable,另一个是$host。

先看看$psversiontable,这个变量拆开来看就是ps-version-table,表示PowerShell中各组件的版本号列表。其中表示PowerShell自己的版本号(PSVersion),也包括.NET的版本号(CLRVersion),还有Windows版本号(BuildVersion),其它的就不一一数了,其实也没有完全搞明白,呵呵。

PS C:\Users\zhanghong> $psversiontable

Name Value
---- -----
CLRVersion 2.0.50727.4984
BuildVersion 6.1.7600.16385
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1

接下来看看$host变量,里面一个Version,表示PowerShell的版本号。
PS C:\Users\zhanghong> $host

Name : ConsoleHost
Version : 2.0
InstanceId : 38d7558e-1810-446d-a81c-41fb6d40ac13
UI : System.Management.Automation.Internal.Host.InternalHostUserI
nterface
CurrentCulture : zh-CN
CurrentUICulture : zh-CN
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace

</div>

您可能想查找下面的文章:

  • PowerShell使用match操作符来筛选数组
  • PowerShell连接SQL SERVER数据库进行操作的实现代码
  • powershell远程管理服务器磁盘空间的实现代码
  • Powershell 查询 Windows 日志的方法
  • Powershell 查找用户的主SMTP地址
  • Powershell 获取特定的网页信息的代码
  • Powershell错误处理之what-if
  • PowerShell 4.0实现自动化设置服务器
  • 揭秘PowerShell 5.0新特性和新功能
  • 简单谈谈PowerShell 4.0中的新命令

相关文章

  • PowerShell函数中的开关参数介绍和创建实例
  • PowerShell中的强类型数组介绍
  • PowerShell实现参数互斥示例
  • Windows Powershell对象=属性+方法
  • Windows Powershell 访问数组
  • PowerShell脚本开发之对指定IP进行端口扫描
  • Windows Powershell 环境变量
  • Powershell小技巧之获取对象可变的特征
  • Powershell创建数组正确、更快的方法
  • WMI入门教程之怎么使用WMI?

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Powershell的break、continue和return简单总结
    • Windows Powershell Do While 循环
    • PowerShell中的强类型数组介绍
    • Windows Powershell 变量的类型和强类型
    • Powershell小技巧之设置IE代理
    • Powershell实现获取电脑序列号功能脚本分享
    • Powershell使用C#实现缩写路径
    • Powershell脚本的4种执行权限介绍
    • Windows Powershell 命令集 cmdlets
    • 探索PowerShell (四) PowerShell的对象、格式与参数

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有