Question

Powershell script using PS remote parameters to allow users to install software such as Visual Studio,...

Powershell script using PS remote parameters to allow users to install software such as Visual Studio, Microsoft office remotely. Provide PS script to install Visual Studio remotely.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
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.
Add a comment
Know the answer?
Add Answer to:
Powershell script using PS remote parameters to allow users to install software such as Visual Studio,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • using Microsoft Visual Studio C++ write a compute program that will allow the user to: 1.Get...

    using Microsoft Visual Studio C++ write a compute program that will allow the user to: 1.Get a Factorial (using a loop) 2. perform addition and subtraction 3.allow the user to quit the program

  • 1. Write a C programme by using visual Studio: a) Write a function with parameters that...

    1. Write a C programme by using visual Studio: a) Write a function with parameters that returen the largest of three integer arguments. So users could call your function (name: max3) to output the maximum of three input values. b) Make a function outside of the main routine. And in the main routine, please call this function and print the harmonic mean. The harmonic mean of two numbers is obtained by taking the inverses of the two numbers, averaging them,...

  • write a programming code for the following problem using Visual Basic Studio VB. Write a program that will allow the user to enter series of mumbers and will give some useful statistics about the mam...

    write a programming code for the following problem using Visual Basic Studio VB. Write a program that will allow the user to enter series of mumbers and will give some useful statistics about the mambers Enter Numbers Button Click-Allow the user to enter series of nambers using imput dialog boxes. Use a loop and add the numbers to the listBox as they are input.. Prompt the user to enter"x" to stop addang numbers. Compute Statistics Button Click-Compute the following statistics...

  • In this assignment, you will be creating a Work Breakout Structure (WBS) for your project using the software applicatio...

    In this assignment, you will be creating a Work Breakout Structure (WBS) for your project using the software application that you have selected. Prepare the WBS, and submit the file to your instructor. This assignment is due Sunday at 11:59 p.m. All assignments should be uploaded in the Assignment area. Project Software Options There are many project management software applications that are designed to help develop project plans and schedules as well as keeping track of these plans and creating...

  • Background: I have an Access-software (~30 simultaneous users) with split front- & back-end, both UI &...

    Background: I have an Access-software (~30 simultaneous users) with split front- & back-end, both UI & DB running on Access-files. Most important features for me are reports & printing, with emphasis on fast development and deployment to the users (updates 1-3 times per week, using as little time as possible). The environment is Win7 + Access 2010. Updates are handled with .BAT-batch file. The database might be upgraded into SQL Server Express or something later this year. Problems: The Access...

  • Implement a software program in C++ t stores and searches the Student records using double-hashing algorithm.  Double...

    Implement a software program in C++ t stores and searches the Student records using double-hashing algorithm.  Double hashing uses the idea of applying a second hash function to key when a collision occurs.   The software program will be based on the following requirements: Development Environment: If the software program is written in C++, its project must be created using Microsoft Visual Studio 2017. If the software program is written in Java, its project must be created using NetBeans v8.2. Algorithm: If...

  • 1. In what ways was Microsoft’s behaviour (a) against the public interest; (b) in the public...

    1. In what ways was Microsoft’s behaviour (a) against the public interest; (b) in the public interest? 2. Being locked in to a product or technology is only a problem if such a product can be clearly shown to be inferior to an alternative. What difficulties might there be in establishing such a case? etwork effects Microsoft is a vertically integrated firm (see page 87), with a dominant position in the operating system market (i.e. Windows) and in certain application...

  • ***I only need the High Level Project Plan (Time to Implement)****** You have recently been hired...

    ***I only need the High Level Project Plan (Time to Implement)****** You have recently been hired by a new Japanese accounting firm, headquarter in Tokyo, as the director ofInformation Systems and Telecommunications. Your assignment is to assist security posture of the firm anddevelop a security structure for this new company. Write your recommendations and reasons to the firm’s CEO. The firm has 600 employees in Tokyo, 50 in Houston, and is planning to open two branch offices in India andCalifornia....

  • 1- TigerOne Bank is a local bank that intends to install a new automated teller machine...

    1- TigerOne Bank is a local bank that intends to install a new automated teller machine (ATM) to allow its customers to perform basic financial transactions. Using the ATM machine users should be able to view their account balance, withdraw cash and deposit funds. The bank wants you to develop the software application that will be installed on the new ATM machines. The following are the requirements for the application:  Users are uniquely identified by an account number and...

  • 1) analyze the following case 2) give a summary and suggest ways for the company ——————...

    1) analyze the following case 2) give a summary and suggest ways for the company —————— Salesforce.com, one of the most disruptive technology companies of the past few years, has single-handedly shaken up the software industry with its innovative business model and resounding success. Salesforce provides customer relationship management (CRM) and other application software solutions in the form of software as a service leased over the Internet, as opposed to software bought and installed on machines locally. The company was...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT