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
    Posts
  • Neil
    Participant
    Post count: 1
    #2397 |

    Hi,

    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?

    Regards,

    Neil.
    .

  • Francois
    Participant
    Post count: 101

    Hi,
    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.