Windows Vista Forums

Start-Transcript in Userprofile\My Documents
  1. #1


    Personne Guest

    Start-Transcript in Userprofile\My Documents

    Hi,

    I'm trying to save all my Powershell Transcripts to a sub-folder of My
    Documents like c:\Documents and Settings\myname\My Documents
    \PowershellTranscripts\

    I'm trying this
    $p= "$env:UserProfile\My Documents\PowerShellTranscripts"
    Start-Transaction -path $p



    But I got this error message
    Start-Transaction : A parameter cannot be found that matches parameter
    name 'path'.
    At line:1 char:24
    + Start-Transaction -path <<<< $p
    + CategoryInfo : InvalidArgument: ( [Start-
    Transaction], ParameterBindingException
    + FullyQualifiedErrorId :
    NamedParameterNotFound,Microsoft.PowerShell.Commands.StartTransactionCommand

      My System SpecsSystem Spec

  2. #2


    Larry__Weiss Guest

    Re: Start-Transcript in Userprofile\My Documents

    One thing I see is that $p is a string that represents a folder, not a file.

    You have to specify a particular file's name to write the transcript into.

    Here's what I include in my profile.ps1 to automatically create a
    transcript of my PowerShell sessions:

    $global:TRANSCRIPT = "$env:UserProfile\My
    Documents\WindowsPowerShell\Transcripts\PSLOG_{0:dd-MM-yyyy}.txt" -f
    (Get-Date)
    Start-Transcript -Append

    I got the idea from this article:
    http://blogs.microsoft.co.il/blogs/s...k-in-time.aspx

    - Larry


    On 5/21/2010 12:30 PM, Personne wrote:

    > Hi,
    >
    > I'm trying to save all my Powershell Transcripts to a sub-folder of My
    > Documents like c:\Documents and Settings\myname\My Documents
    > \PowershellTranscripts\
    >
    > I'm trying this
    > $p= "$env:UserProfile\My Documents\PowerShellTranscripts"
    > Start-Transaction -path $p
    >
    > But I got this error message
    > Start-Transaction : A parameter cannot be found that matches parameter
    > name 'path'.
    > At line:1 char:24
    > + Start-Transaction -path<<<< $p
    > + CategoryInfo : InvalidArgument: ( [Start-
    > Transaction], ParameterBindingException
    > + FullyQualifiedErrorId :
    > NamedParameterNotFound,Microsoft.PowerShell.Commands.StartTransactionCommand

      My System SpecsSystem Spec

  3. #3


    Personne Guest

    Re: Start-Transcript in Userprofile\My Documents

    I agree with you, but when I run just Start-transcript with no
    parameter it does create a new file automatically like
    PowerShell_transcript.20100521102901.txt

    Seems the path option force me to manage the filename then

    Thank

      My System SpecsSystem Spec

  4. #4


    Larry__Weiss Guest

    Re: Start-Transcript in Userprofile\My Documents

    I think you are correct.

    From the help text for Start-Transcript

    -Path <string>
    Specifies a location for the transcript file. Enter a path
    to a .txt file. Wildcards are not permitted.

    If you do not specify a path, Start-Transcript uses the path
    in the value of the $Transcript global variable. If you have
    not created this variable, Start-Transcript stores the transcripts
    in the $Home\My Documents directory as
    \PowerShell_transcript.<time-stamp>.txt files.

    If any of the directories in the path do not exist,
    the command fails.

    - Larry


    On 5/21/2010 1:18 PM, Personne wrote:

    > I agree with you, but when I run just Start-transcript with no
    > parameter it does create a new file automatically like
    > PowerShell_transcript.20100521102901.txt
    >
    > Seems the path option force me to manage the filename then
    >
    > Thank

      My System SpecsSystem Spec

Start-Transcript in Userprofile\My Documents problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start menu> Documents> Documents Missing Dinah K General Discussion 4 25 May 2009
[CTP2] Start-Transcript bug reminder Shay Levi PowerShell 0 07 May 2008
start-transcript apm PowerShell 2 02 Nov 2007
Start-Transcript and output from legacy applications Greg Wojan PowerShell 0 11 Apr 2007
How much of a session does start-transcript capture? Andrew Watt [MVP] PowerShell 1 22 May 2006