Powershell根据用户输入做出响应 [英] Powershell respond based on user input

查看:229
本文介绍了Powershell根据用户输入做出响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是你听过的最简单的问题。但是我必须问这个因为我是Powershell的新手..



我需要powershell来询问用户输入,然后根据输入,它必须读取与该输入对应的xml文件的内容。



如果用户输入为1则应该读取来自已定义的xml文件的1的相应数据。有人可以帮我解决这个问题吗?

Hi, This may be the easiest question you have ever heard..But I must ask this since I am new to Powershell..

I need powershell to ask for a user input and then based on the input it must read the contents of an xml file corresponding to that input.

If user input is 1 then it should read the corresponding data of 1 from an xml file that is already defined.Can someone please help me on this??

推荐答案


a = [xml](get-content C:\ temp\centers.xml)
a = [xml](get-content C:\temp\centers.xml)


b =读取主机输入中心



if((
b = Read-Host "Enter Center"

if ((


这篇关于Powershell根据用户输入做出响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆