locked
What does supply values for the following parameter mean? RRS feed

  • Question

  • I am writing a script that will read, compare and replace a value when it is true or ignore when it is false.

    The script is running and it says "cmdlet Get-ConfigFile at command pipeline position 1

    Supply values for the following parameters:

    BaseFolder: "

    I have no idea what i must supply and where but I am assuming

    I must make some changes to

    the $BaseFolder line or in my config file. Any help will be greatly appreciated

    try { $BaseFolder = Split-Path -parent $MyInvocation.MyCommand.Definition $ConfigFile = Get-ConfigFile -FileName "myLog.ini" $IniContent = Get-IniContent -FilePath $ConfigFile $LogFile = $IniContent.logging.log_file Set-Logger -LogFile $LogFile $Global:Logger = New-LogFile } catch { Write-Error ("Exit the script : `n{0} `n{1} `nException Type = {2} `n{3}" -f $_.Exception.Message, ` $_.ScriptStackTrace, ` $_.Exception.GetType().FullName, ` $_.ToString()) exit }


    Tuesday, June 20, 2017 10:40 AM

All replies

  • You've said you want the parent folder. but not what folder to check for.

    for example:

    $BaseFolder = Split-Path -Parent c:\Testing\tests


    Tuesday, June 20, 2017 11:30 AM
  • try
    {
        $BaseFolder = Split-Path
    -parent $MyInvocation.MyCommand.Definition
        $ConfigFile = Get-ConfigFile
    -FileName "$BaseFolder\myLog.ini"
        $IniContent = Get-IniContent
    -FilePath $ConfigFile
    
        $LogFile = $IniContent.logging.log_file
        Set-Logger
    -LogFile $LogFile
        $Global:Logger =
    New-LogFile
    }
    catch
    {
        Write-Error
    ("Exit the script : `n{0} `n{1} `nException Type = {2} `n{3}"
    -f
            $_.Exception.Message,
    `
            $_.ScriptStackTrace, `
            $_.Exception.GetType().FullName,
    `
            $_.ToString())
        exit
    }


    Tuesday, June 20, 2017 12:38 PM
  • Hi Breccs,

    what is :Get-ConfigFile???

    please run get-help get-configfile -full to check the related parameters.

    Best regards,

    Andy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, June 21, 2017 5:15 AM