hello guys, i have followed all the steps in this link http://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/
to run my script remotely using Invoke-Command -ComputerName 192.168.8.134 -credential Administrator -ScriptBlock {& "c:\update\run.bat"}
$Turl1 = "http://localhost/Vscripts/" $Turl2 = "http://localhost/Vscripts/versions.txt" $TtempFile1 = "$(Get-Location)\temp1.tmp" $TtempFile2 = "$(Get-Location)\temp2.tmp" $TscriptsLocation = "$(Get-Location)\" $autoConfigFile = Join-Path $TscriptsLocation "\config\auto_config.xml" $autoEnable = $true if ((test-path $autoConfigFile) -and $autoEnable){ $auto_configs = [xml] (gc $autoConfigFile) $auto_var = $auto_configs.auto_config.config.obj $auto_var | % { if (-not $autoEnable){$autoValue = $false} else {$autoValue = $_.value} Set-Variable -name $_.name -value $autoValue } $auto_App_list = @{ 'a' = $XML_auto_a_folder 'b' = $XML_auto_b_folder 'c' = $XML_auto_v_folder } } . .\sbin\start.ps1
but i am still getting this error message
. : The term '.\sbin\start.ps1' is not recognized as the name of a cmdlet, + CategoryInfo : NotSpecified: (. : The term '....e of a cmdlet, :String) [], RemoteExceptio n + FullyQualifiedErrorId : NativeCommandError + PSComputerName : 192.168.8.134 function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\update\run.ps1:35 char:3 + . .\sbin\start.ps1 + ~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (.\sbin\start.ps1:String) [], Co mmandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException NotSpecified: (:) [], RemoteExceptionby the way when using Enter-PSSession and then run the script from there everything works fine
- Edited by Vagharsh 20 hours 38 minutes ago