Tagged Questions
0
votes
1answer
56 views
Powershell v3 Remoting from C# using Enter-PSsession
I am trying to use Enter-PSsession from C# to enable and use Powershell remoting to run commands remotely.
Here is a code
Runspace remoteRunspace = Runspaces.RunspaceFactory.CreateRunspace();
...
0
votes
1answer
88 views
Running Remote Powershell Commandlet that wraps a process exits before completion
I have a custom PowerShell commandlet that I have created in C# that spins up some instances of vstest.console.exe and publishes the test results to a .trx file or to tfs.
This commandlet works in ...
3
votes
3answers
75 views
PSRemoting performance overhead with get-childItem
This completes in 2.3 minutes on LOCALSERVER:
A: measure-command {$x = invoke-command {gci -recurse "C:\"}}
This completes in 38.4 minutes on LOCALSERVER:
B: measure-command {$x = ...
0
votes
1answer
139 views
Restarting PC's and writing to the event log with a custom message
I have written a script in PowerShell that will remotely restart a list of PC's using the 'Restart-Computer' command.
Is there a way of adding a custom message to the systems event log, to explain ...
0
votes
0answers
183 views
powershell - execute cmdlet remotely with php
I need to get status of service for simple monitoring tool. There is no problem to get status locally, but when I try to get status of service on remote computer like this:
<?php
$output = ...
1
vote
2answers
987 views
How to import custom PowerShell module into the remote session?
I'm developing a custom PowerShell module, which I'd like to use in context of a remote session to a different computer. The following code (which obviously doesn't work) explains what I'm trying to ...
1
vote
2answers
122 views
How can I execute a block of PowerShell in a remoting session that is a string, and not a ScriptBlock?
I'm trying to customise my prompt in a remote PowerShell session. This all works fine:
$session = New-PSSession MyRemoteServer
Invoke-Command -Session $session -ScriptBlock {
New-PSDrive -Name ...
5
votes
1answer
148 views
How can I add color to the machine name in the prompt of a PowerShell Remoting session?
To make it more obvious when I'm remoted to a live/production server, I thought it'd be handy to be able to colour the machine name I'm connected to when using remote PowerShell sessions.
However, I ...
1
vote
0answers
262 views
Is it possible to run powershell using SSH from remote-host?
Is it possible to run powershell script using "ssh" or any protocol from remote-host (Linux)?
Followed these steps:
Have 'freeSHd' installed which runs ssh/ telnet services.
Able to connect Windows ...
0
votes
1answer
200 views
Upgraded to PS3, System.Net.WebClient not working on some machines
I am running in a lab environment and need to automate about 50 machines. I am trying to recover an .xml wireless network profile from a server then install it. This command is being sent from 1 ...
1
vote
1answer
657 views
Script to export to excel
I Have below script:-- looking for help to convert the output to excel format
$servers = get-content “c:\list.txt”
foreach ($server in $servers)
{
$server
$command = “quser /server:” + $server
...
0
votes
1answer
119 views
Remote Tab in ISE Connects to a powershell 1.0 session
I have PowerShell v3 installed and launch the ISE from my local workstation. When I open a remote tab to a server(win2K8R2 WMF 3 installed) I seem to get a powerShell V1 session. I checked this by ...
0
votes
1answer
74 views
System.EnterpriseServies.Wrapper.dll missing in Powershell Work Flow
I run Server 2008 R2 as a workstation (mainly to get Hyper-V IIS 7.5). I’ve been playing around with this system for a while and it’s hardly pure! ;-)
Today, I loaded the latest set of patches, and ...