# Powershell **Repository Path**: java2demo/Powershell ## Basic Information - **Project Name**: Powershell - **Description**: 在windows平台上调用(本地或远程计算机)powershell进行管理计算机 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2015-08-29 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #Powershell
release 版本1
样例:
SPowershell newshell = new QidianPowershell();
//此方法是调用本地的powershell执行任务
//public String sendOrder(String...order)
//此方法是调用远程的powershell执行任务
//public String sendOrder(String IP,String user,String pass,String...order)
//获取结果
//public Result getResult(String flags)
String flags=newshell.sendOrder(//"XX.XX.XX.XX",
//												//"test\\user",
//												//"password",
												"pwd | foreach-object {  echo $_.Path }");
						System.out.println(flags);
						Result re = newshell.getResult(flags);
						while(re.getRCode().getVal()==1){
							re=newshell.getResult(flags);
							Thread.sleep(1000);
						}
						for(String str:re.getResult()){
							System.out.println(flags+"-->"+str);
						}