S
S
Setitle2021-03-17 12:09:54
PowerShell
Setitle, 2021-03-17 12:09:54

Where is the output of the command execution?

Hello! I perform simple operations, but at the end nothing is displayed at all. Neither that the service is already running or has started, nor that a setting in the registry has changed. I wanted to write the result to a file, but I realized that nothing is displayed on the screen in the console, so the file is empty. As if "Out-Null" is written everywhere .. What's the catch? Somehow everything is easier in CMD :))
PS Google didn’t ban me, I read it, it seems to the holes already ..

$(
$path = "HKLM:\SYSTEM\CurrentControlSet\services\1C:Enterprise 8.3 Server Agent (x86-64)"
Set-ItemProperty -Path $path -Name "ImagePath" -Value '"C:\Program Files\1cv8\8.3.17.1851\bin\ragent.exe" -srvc -agent -regport 1541 -port 1540 -range 1560:1591 -d "E:\1cv8\srvinfo"'
start-Service "1C:Enterprise 8.3 Server Agent (x86-64)"
) *>&1 > "C:\script\1cSrvCopy.log"


6051c80b96bf1745702647.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
azarij, 2021-03-17
@Setitle

for start-service, you need to specify the -Passthru parameter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question