Process in Shell

2023-11-19

$PID    #current process
Get-Process
Get-Process | Select-Object Name
Get-Process -processname "jm" | Select-Object *
Get-Process -processname "jm" | Select-Object WorkingSet64
Stop-Process -processname baiduyunguanjia   
stop-Process -Id 9556
kill -Id 9556

# help
get-help stop-process
Get-help kill
get-help Stop-Process -Examples
Get-Help kill -Online
Get-Process | Where-Object {$_.ProcessName.Contains("baiduyunguanjia") }
Get-Process | Where-Object 
# special notation
# http://blog.chinaunix.net/uid-9781829-id-1997782.html

# kill process
{$_.ProcessName.Contains("baiduyunguanjia") } | Stop-Process -CONFIRM
Get-Process | Where-Object {$_.ProcessName.Contains("baiduyunguanjia") } | Stop-Process -force

# date 
Get-Date
(Get-Date).DayOfWeek

# data structure 
Get-Member     # most important 
Get-Help -Name # get help information
Get-Command    # command
Get-Service | Format-table
            | Format-Custom
            | Format-Wide
            | Format-List 
Get-Service | Get-Member -MemberType Property
Get-Service | format-table name, servicetype, canshutdown            
# Filter
1,2,3,4 | Where-Object -FilterScript {$_ -lt 3}
Get-WmiObject -Class Win32_SystemDriver | Get-Member -MemberType Property
Get-WmiObject -Class Win32_SystemDriver | Where-Object -FilterScript {$_.State -eq "Running"}
Get-WmiObject -Class Win32_SystemDriver | Where-Object -FilterScript {$_.State -eq "Running"} | Where-Object -FilterScript {$_.StartMode -eq "Auto"}
Get-WmiObject -Class Win32_SystemDriver | Where-Object -FilterScript {$_.State -eq "Running"} | Where-Object -FilterScript {$_.StartMode -eq "Manual"} | Format-Table -Property Name,DisplayName
Get-ChildItem env:
# change file constrain
# http://www.cnblogs.com/binw/p/3921743.html
Get-Acl -Path <File or Folder Path> | Format-List
# get one file's right and give it to another
Get-Acl "W:\Test\test01.txt" | Set-Acl -Path "W:\Test\test02.txt"
# WinSCP does batch processing
# http://www.cnblogs.com/binw/p/4065607.html 
# a reference blog
# http://www.cnblogs.com/dreamer-fish/archive/2013/01/26/2878144.html
# some basic operations
# remove all files in a folder
Remove-Item C:\tobedeleted –Recurse
# reborn current computer
(Get-WmiObject -Class Win32_OperatingSystem -ComputerName .).Win32Shutdown(2)
# get all child item recururse
Get-ChildItem –Force c:\directory –Recurse
Get-WmiObject -Class Win32_ComputerSystem
Get-WmiObject -Class win32_BIOS -ComputerName .
Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName .
# get current user
Get-WmiObject -Class Win32_ComputerSystem -Property UserName -ComputerName .
Get-WmiObject -Class Win32_Product -ComputerName . | Format-Wide -Column 1
# current IP address
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Format-Table -Property IPAddress
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Select-Object -Property [a-z]* -ExcludeProperty IPX*,WINS*
Get-WmiObject -Class win32_networkadapterconfiguration -Filter "DHCPEnabled = true" -ComputerName .
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=true -ComputerName . | ForEach-Object -Process {$_.EnableDHCP()}
# software management
# equip MSI packet
(Get-WMIObject -ComputerName TARGETMACHINE -List | Where-Object -FilterScript {$_.Name -eq "Win32_Product"}).Install(\\MACHINEWHEREMSIRESIDES\path\package.msi)
# uplevel MSI
(Get-WmiObject -Class Win32_Product -ComputerName . -Filter "Name='name_of_app_to_be_upgraded'").Upgrade(\\MACHINEWHEREMSIRESIDES\path\upgrade_package.msi)
# remove current packet from current computer
(Get-WmiObject -Class Win32_Product -Filter "Name='product_to_remove'" -ComputerName . ).Uninstall()
# machine management
# shut down another computer after 60 seconds
Start-Sleep 60; Restart-Computer –Force –ComputerName TARGETMACHINE
# add printer
(New-Object -ComObject WScript.Network).AddWindowsPrinterConnection(\\printerserver\hplaser3)
# remove printer
(New-Object -ComObject WScript.Network).RemovePrinterConnection("\\printerserver\hplaser3 ")


EXE

> http://www.tuicool.com/articles/AbmAvq
>ttp://www.cnblogs.com/dudu/archive/2011/08/23/ProcessStartInfo_bat_powershell.html
>http://club.topsage.com/thread-2134637-1-1.html
Parameter:
> http://www.pstips.net/powershell-pass-args-to-scripts.html
>http://blog.vichamp.com/powershell/tip/2014/04/30/getting-arguments-from-command-line/
>http://www.pstips.net/question/4418.html
>http://www.jb51.net/article/49853.htm
>http://www.pstips.net/powershell-launching-applications.html
>http://www.jb51.net/article/53583.htm
>http://www.jb51.net/article/53065.htm
IP:
> http://www.pstips.net/get-current-ip.html
> http://www.pstips.net/get-all-assigned-ip-addresses.html
>http://www.cnblogs.com/dudu/archive/2011/08/23/ProcessStartInfo_bat_powershell.html
Create New Folder:
> http://blog.csdn.net/itanders/article/details/1731811
Process:
> http://stackoverflow.com/questions/651223/powershell-start-process-and-cmdline-switches
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Process in Shell 的相关文章

  • C++ Template Class List

    转载请注明 http blog csdn net c602273091 article details 50717999 Introduction STL STL Standard Template Library 标准模板库 是惠普实验室
  • 写论文注意事项

    文献检索 搜索引擎的高级功能 搜索引擎主要www google com和scholar google com www baidu com则仅在检索中文时稍好点 英文很差 用处不大 我们常用的google侧重于网页的检索 Scholar则主要
  • Some Laws in IT

    Moore s Law 摩尔定律是由英特尔 Intel 创始人之一戈登 摩尔 Gordon Moore 提出来的 其内容为 当价格不变时 集成电路上可容纳的元器件的数目 约每隔18 24个月便会增加一倍 性能也将提升一倍 换言之 每一美元所
  • Jitter Removal in Image and Sequence

    去除重影 消抖 在 jitter removal images and video sequences Using robust decision Based Adaptive spatio temporal median Algorith
  • Conference and Journal Level in 2016

    中国计算机学会推荐国际学术会议和期刊目录 2015 年 中国计算机学会 中国计算机学会推荐国际学术期刊 计算机体系结构 并行与分布计算 存储系统 一 A 类 序号 刊物简称 刊物全称 出版社 网址 1 TOCS ACM Transactio
  • Video Evaluation by Python

    Here is the code to calculate for PSNR and SSIM of YUV My code has its advantage that it can process the problem by batc
  • Latex Skills

    ModernCV http 519488126 blog 163 com blog static 722401602014010555221 Paper 1 Blank 两个quad空格 a qquad b a qquad b 两个m的宽度
  • Evaluate Video Quality

    How to evaluate video PSNR and SSIM PSNR is easy to calculate http blog csdn net c602273091 article details 49861817 SSI
  • ML Introduction

    Task of ML Supervised Learning Classification and regression Unsepervised Learning Clustering Density Estimation Reducti
  • Visual Assist X AND MSDN

    assist X 推荐 这款插件是visual studio或者vc的插件 没想到vs用起来也可以这么爽 用起来居然比sourceinsight还好用 好用到哭 好用到哭 好用到哭 自动补全 补全的时候还可以看到对这个补全的东西的介绍 鼠标
  • SourceInght And Sublime Text 2 Using Skills

    工欲善其事 必先利其器 Sourceinsight 加入时间 http my oschina net xDreamYY blog 228814 Sourceinsight 加入快捷键 http www cnblogs com wangqig
  • 有实力的人才能谈梦想

    我总是徘徊 在犹豫 觉得自己做不到 只是在苟延残喘摆了 所谓的目标也不可能实现 今天我发现我做到了 原来也不是那么遥不可及 是自己不够自信 不够淡定 有实力的人聊梦想 没理想的人就想想怎么混工作吧 有实力的人 自信 坚定的毅力 不怕失败 淡
  • memset in C++ and C

    definition memset是计算机中C C 语言函数 将s所指向的某一块内存中的前n个 字节的内容全部设置为ch指定的ASCII值 第一个值为指定的内存地址 块的大小由第三个参数指定 这个函数通常为新申请的内存做初始化工作 其返回值
  • IMAGE REGISTRATION

    Classification Nature area based and feature based Different viewpoints multiview analysis image from different viewpoin
  • Latex Picture And Table Setting

    Four Picture in one column begin figure htb begin minipage b 48 linewidth centering centerline includegraphics width 4 0
  • Python Using EXE

    OS This method has its disadvantage if we want to stop this process We need do it by ourselves except seize the terminal
  • File Processing by Python

    Go through all the file in destination path import os import sys def GetFileList dir fileList newDir dir if os path isfi
  • ML Impossible and Rescure

    No Rule to Define will cause conflict Using available data to estimate target function if without rule target is unknown
  • Binary Classification Core PLA

    Target Step Verify My verification Pocket Algorithm Pros Cons of PLA
  • Process in Shell

    PID current process Get Process Get Process Select Object Name Get Process processname jm Select Object Get Process proc

随机推荐

  • React之state、hooks性能分析

    目录 一 state 1 为什么使用setState 2 setState异步更新 3 如何获取异步的结果 4 setState一定是异步吗 5 源码分析 6 数据的合并 7 多个state的合并 二 为什么需要Hook 三 Class组件
  • stm32之iap实现应用(基于串口,上位机,详细源码)

    开发环境 Window 7 开发工具 Keil uVision4 硬件 stm32f103c8t6 篇幅略长 前面文字很多 主要是希望能让小白们理解 后面就是实现步骤 包括实现的代码 在研发调试的时候我们一般用烧录器下载代码 对于stm32
  • 4.0创建型模式 描述

    创建型模式的主要关注点是 怎样创建对象 它的主要特点是 将对象的创建与使用分离 这样可以降低系统的耦合度 使用者不需要关注对象的创建细节 对象的创建由相关的工厂来完成 就像我们去商场购买商品时 不需要知道商品是怎么生产出来一样 因为它们由专
  • mysql按照某个字段值内容排序

    举个栗子 假如一个商品下 有多个货品 各个货品的状态值都不一样 那么当只想展示商品中的某一个货品时 希望用户端看到的优先级是在售的货品中的一个 根据mysql提供的方法 field column value1 value2 value3 可
  • RTThread学习有关的Keil的两个符号 $Sub$ $main 与 $Super$ $main

    Keil的两个符号 Sub 与 Super 是其做的打 补丁 功能 具体调用方法就是程序中包含有main函数 和 Sub main Super main 两个符号 源码先放出来 re define main function int Sub
  • 三校生计算机教育,三校生有什么专业

    三校生的专业有计算机信息类 旅游类 艺术类 电工技术类 农林类 机械类 建筑工程类 经济管理类 外语类 烹饪 生物化学类 国土资源类 体育类 教育类 交通运输类 自动化类 包装印刷类 医学类 护理学 药学类 铁道运输类 师范类 水利水电类
  • CTreeView

    ClassWizard为CTreeCtrl 树控件 添加的NM DBLCLK 双击 消息的响应函数中带有一个NMHDR 型指针形参 1 OnDblClkTree NMHDR pNMHDR LRESULT pResult 这个陌生的指针类型常
  • IDEA中使用Java连接MySQL数据库的配置和使用方法

    文章目录 IDE和必要配置 数据库连接代码 IDE和必要配置 IDE IntelliJ IDEA 2023 1 必要配置 1 安装好JDK 并且配置环境变量 2 导入MYSQL数据库所需的驱动 如果没有导入 可以参考这篇文章IDEA中的My
  • android Scroller

    参考 http www linuxidc com Linux 2016 01 127276 htm 以前只知道怎么使用scroller 照猫画虎 复制粘贴 今天遇到使用scroller 还是要去搜索 这样不行 要搞懂原理 上面的博客写的很漂
  • 静态链表

    include
  • Linux下防御ddos攻击

    1 Linux下防御ddos攻击 导读 Linux服务器在运营过程中可能会受到黑客攻击 常见的攻击方式有SYN DDOS等 通过更换IP 查找被攻击的站点可能避开攻击 但是中断服务的时间比较长 比较彻底的解决方法是添置硬件防火墙 不过 硬件
  • spring-boot的快速开发

    1 使用Intellij中的Spring Initializr来快速构建Spring Boot Cloud工程 菜单栏中选中Files gt New gt Projects 这个Initializr Service URL 我们一般使用默认
  • 短视频文案如何写,学会以下几种方法,离爆款绝对不远。

    短视频运营 视频肯定是关键 文案是对视频的一种衬托 但是也并不代表文案不重要 在短视频中的段子文案也是精心设计的 所以今天要分享的是视频介绍里的文案 是怎么炼成的 下面就跟大家讲讲如何写出比较好的视频文案 仅仅是形式 具体还是要看自己进行灵
  • 如何在figma中做交互设计

    近一年来 Figma它可以说是体验设计领域最受欢迎的工具 最近 我开始频繁地工作 Axure9 0和Figma切换使用 深刻感受到设计细节带来的体验差异化 今天 通过一些细节和亮点 总结了工具软件体验设计的几个原则 添加图片注释 不超过 1
  • 手把手教你K最近邻分类器分类CIFAR-10

    KNN算法全称为k Nearest Neighbor Classifier 即k最近邻分类器 它可以看作是Nearest Neighbor Classifier最近邻分类器的加强版 无论是最近邻分类器还是k最近邻分类器 其原理都比较简单 其
  • 前端基础之JavaScript

    知识预览 JavaScript概述 JavaScript的基础 JavaScript的对象 BOM对象 DOM对象 实例练习 js扩展 一 JavaScript概述 JavaScript的历史 1992年Nombas开发出C minus m
  • Git 命令/配置笔记

    创建分支命令 git branch 分支名 切换分支命令 git checkout 分支名 合并分支 到当前分支 git merge 列出本地分支 git branch 删除分支 git branch d 分支名 指定标签信息命令 git
  • ESP8266 ERROR:cut here for exception decoder

    在使用ESP8266获取网站的json信息时 串口输出错误信息 cut here for exception decoder 解决办法 获取json的格式不正确 检查json格式的括号 是否缺少
  • 静态代码扫描中Java资源对象关闭的探究

    本人在探究静态代码扫描中资源对象关闭规则遇到了一些疑惑 本文将这些疑惑记录下来并逐一找出解答 包括在哪些情况下 这些资源对象需要手动关闭 怎么正确的关闭 哪些情况下不需要手动关闭 以及为什么 资源对象包括很多种 本文重点关注输入输出流对象和
  • Process in Shell

    PID current process Get Process Get Process Select Object Name Get Process processname jm Select Object Get Process proc