How to specify installation location

Welcome Forums General PowerShell Q&A How to specify installation location

This topic contains 1 reply, has 2 voices, and was last updated by

10 months ago.

  • Author
  • #99487

    Points: 1
    Rank: Member

    I need to deploy an application via PS & SCCM.
    How is the best method of telling PS that the msi is in the same directory as the PS script?
    I can't hard code the install directory as that will be determined by SCCM.

    I read that this is the correct method, however it' errors out for me.

    $scriptpath = $MyInvocation.MyCommand.Path
    $dir = Split-Path $scriptpath

    Error is 'Split-Path : Cannot bind argument to parameter 'Path' because it is null.'

  • #99493

    Points: 643
    Helping Hand
    Rank: Major Contributor

    In scripts you have the built in automatic variable $PSScriptRoot pointing to the directory of the script.

The topic ‘How to specify installation location’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort