小编guu*_*lee的帖子

如何在powershell远程会话中编辑文件(powershell)

我使用powershell远程连接到另一台计算机,非常好.可以做很多,但如何编辑文件?

PS C:\ Users\guutlee> Enter-PSSession -ComputerName appprod

[appprod]:PS C:\ Users\guutlee\Documents> cd\myapp

[appprod]:PS C:\ myapp>

如何在远程计算机上的文件上打开文件编辑器?

[appprod]:PS C:\ myapp>编辑app.config

所以编辑"filename"似乎挂起,来自powershell.exe或powershell_ise.exe

我唯一能想到的就是退出pssession和"start\webprod\c $\inetpub\myapp\web.config",这将打开visual studio.

[appprod]:PS C:\ myapp>退出

PS C:\ Users\guutlee> start\agobuild\c $\myapp\app.config

PS C:\ Users\guutlee> Enter-PSSession -ComputerName appprod

[appprod]:PS C:\ Users\guutlee\Documents> cd\myapp

[appprod]:PS C:\ myapp> myapp.exe

当然,我必须重新找到该文件,希望c $共享可用且可访问,并重新连接我的pssession并在我想继续时重新找到我的工作目录.它似乎并不优雅.

我可以把它包裹起来这是一个功能,但很难把我的脑袋包裹起来......

那么如何使用远程pssession方便地编辑文件?

编辑

kbrimington的帖子让我想到了ssh的-X选项.对于PowerShell会话而言,将窗口应用程序转发回原始窗口环境可能会是一件非常棒的事情......

但我仍然很高兴只是编辑文件.

编辑

使用vi,emacs,cmd和编辑测试

PS C:\ Users\Meredith> Enter-PSSession -ComputerName appprod

[appprod]:PS C:\ Users\guutlee\Documents> C:\ vim\vim72\vim filename.txt

[appprod]:PS C:\ Users\guutlee\Documents> C:\ emacs-23.2\bin\emacs.exe -nw filename.txt

emacs.exe:emacs:标准输入不是tty

+ CategoryInfo          \: NotSpecified: (emacs: standard input …
Run Code Online (Sandbox Code Playgroud)

powershell editing powershell-remoting

33
推荐指数
2
解决办法
4万
查看次数

生成的元数据(WSDL)中的.net 4 WCF端点指向节点而不是负载平衡(NLBS)IIS6上托管的虚拟主机

这很简单.我有一个wcf服务(没什么特别的,只是新项目 - > WCF服务应用程序),在Visual Studio中运行良好.当我将它部署到集群IIS6环境时,它主要工作.我可以发送请求并得到回复.

但是,生成的元数据始终引用群集中的特定节点而不是群集虚拟名称.

https://clustername.test.com/WcfService1/Service1.svc
Run Code Online (Sandbox Code Playgroud)

在HTML中显示以下内容:

Service1 Service

You have created a service.

To test this service, you will need to create a client 
and use it to call the service. You can do this using 
the svcutil.exe tool from the command line with the 
following syntax:

svcutil.exe https://node1.test.com/DocrRetention/Service1.svc?wsdl
Run Code Online (Sandbox Code Playgroud)

它显示节点名称(node1.test.com)而不是群集名称.

https://clustername.test.com/WcfService1/Service1.svc?wsdl 
Run Code Online (Sandbox Code Playgroud)

显示以下xml:

...
    <wsdl:types>
        <xsd:schema targetNamespace="http://tempuri.org/Imports">
            <xsd:import schemaLocation="https://node1.test.com/WcfService1/Service1.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
            <xsd:import schemaLocation="https://node1.test.com/WcfService1/Service1.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
            <xsd:import schemaLocation="https://node1.test.com/WcfService1/Service1.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/WcfService1"/>
        </xsd:schema>
    </wsdl:types>
...
    <wsdl:service name="Service1">
        <wsdl:port name="BasicHttpBinding_IService1" binding="tns:BasicHttpBinding_IService1">
            <soap:address location="https://node1.test.com/WcfService1/Service1.svc"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions> …
Run Code Online (Sandbox Code Playgroud)

wcf wsdl iis-6 .net-4.0 nlb

4
推荐指数
1
解决办法
2532
查看次数

标签 统计

.net-4.0 ×1

editing ×1

iis-6 ×1

nlb ×1

powershell ×1

powershell-remoting ×1

wcf ×1

wsdl ×1