Обновление Firestore в режиме реального времени слушателя в Vue

Попробуйте что-то вроде следующего (непроверено) - обратите внимание на комментарии, которые относятся к тому, что вы пробовали:

param (
  # Use $(...) to use a command's output as a parameter default value.
  # By contrast assigning "..." only assigns a *string*.
  $session = $(New-PSSession -ComputerName $server -Credential $mycredentials),
  # To be safe, better to `-escape $ inside "..." if it's meant to be a literal.
  $SourceFile = "\\server\D`$\Somefolder\vs.exe",
  $Destination = "D:\Somefolder"
)

Write-Host "Installing Visual Studio"

Copy-Item -FromSession $session -Path $SourceFile -Destination $destination -Force

# You don't need the session anymore now that you've copied the file.
# Normally you'd call
#     Remove-PSSession $session
# However, given that the session may have been passed as an argument, the caller
# may still need it.

# With the installer present on the local machine, you can invoke
# Start-Process locally - no need for a session.
Start-Process -Wait $Destination\vs.exe -ArgumentList '--quiet', '--installPath "C:\VS"'

# No need for Exit-PSSession (which is a no-op here), given that 
# you haven't used Enter-PSSession.
0
задан Frank van Puffelen 19 January 2019 в 02:10
поделиться