Split-Path -Path (($myInvocation.MyCommand.Definition)

//Split-Path -Path (($myInvocation.MyCommand.Definition)
Split-Path -Path (($myInvocation.MyCommand.Definition)2017-11-07T09:13:37+00:00

The Toolkit Forums General Split-Path -Path (($myInvocation.MyCommand.Definition)

  • Author
  • Neil
    Post count: 1


    I’m running into an issue whereby an Error log I’m creating while running is being filled with an error that is created within the write-log function in AppDeployToolkitMain.ps1. It occurs on machines that are running Powershell v2, I get:
    Split-Path : Cannot find drive. A drive with the name ‘& { . ‘C’ does not exist

    which floods the error logs. Anyone got an easy fix for this? Here’s the line that causes the issue:

    [string]$ScriptSource = Split-Path -Path $myInvocation.MyCommand.Definition -Leaf -ErrorAction ‘Stop’

    I can work around it, I just wondered if this has been seen before/already tackled?



  • Francois
    Post count: 105

    Never saw that error. Insert a breakpoint into your script then run manually those command. Probably, you will recreate those error.

You must be logged in to reply to this topic.