invoke-command

Invoking a Java Method in JSP

限于喜欢 提交于 2019-11-27 16:11:45
问题 Setup Mac OSX 10.6.8, Apache Tomcat 6.0.16, Java1.6.0_29, Eclipse IDE Indigo. I asked a similar question to this before at How to execute and include a Java API from a Web App project but the set up has since changed in that i now have the Java code in the WebAp I am trying to invoke a Java Method from a JSP page and return the results. I have looked at a lot of posts but I’m afraid my lack of experience with either language is the main problem. I have a JSP WebAp that searches an XML

Passing array to another script with Invoke-Command

纵然是瞬间 提交于 2019-11-27 16:10:42
I'm stuck trying to figure this out. I've seen the other articles and have tried everything, but I'm not getting anywhere. I am trying to pass an array as an argument to another PS script. Here's what I'm trying: $IPArray = Get-Content C:\ListofIps.txt Invoke-Command -Computername $server -Credential $cred -FilePath "C:\script.ps1" -ArgumentList (,$IPArray) The 5 values in $IPArray aren't being passed to the script that I call. Thanks in advance, guys, I really appreciate any help you can give... Use: ... -ArgumentList (,$IPArray) Because the ArgumentList parameter expects an array you've

How to capture the Return Value of a ScriptBlock invoked with Powershell's Invoke-Command

纵然是瞬间 提交于 2019-11-27 11:44:08
问题 My question is very similar to this one, except I'm trying to capture the return code of a ScriptBlock using Invoke-Command (so I can't use the -FilePath option). Here's my code: Invoke-Command -computername $server {\\fileserver\script.cmd $args} -ArgumentList $args exit $LASTEXITCODE The problem is that Invoke-Command doesn't capture the return code of script.cmd, so I have no way of knowing if it failed or not. I need to be able to know if script.cmd failed. I tried using a New-PSSession

How do I pass named parameters with Invoke-Command?

梦想的初衷 提交于 2019-11-26 16:01:35
I have a script that I can run remotely via Invoke-Command Invoke-Command -ComputerName (Get-Content C:\Scripts\Servers.txt) ` -FilePath C:\Scripts\ArchiveEventLogs\ver5\ArchiveEventLogs.ps1 As long as I use default parameters, it works fine. However, the script has 2 named [switch] parameters (-Debug and -Clear) How can I pass the switched parameters via the Invoke-Command? I've tried the -ArgumentList but I'm getting errors so I must have the syntax wrong or something. Any help is greatly appreciated. Jaykul -ArgumentList is based on use with scriptblock commands, like: Invoke-Command -Cn

How do I pass named parameters with Invoke-Command?

左心房为你撑大大i 提交于 2019-11-26 04:19:29
问题 I have a script that I can run remotely via Invoke-Command Invoke-Command -ComputerName (Get-Content C:\\Scripts\\Servers.txt) ` -FilePath C:\\Scripts\\ArchiveEventLogs\\ver5\\ArchiveEventLogs.ps1 As long as I use default parameters, it works fine. However, the script has 2 named [switch] parameters (-Debug and -Clear) How can I pass the switched parameters via the Invoke-Command? I\'ve tried the -ArgumentList but I\'m getting errors so I must have the syntax wrong or something. Any help is