{"id":6142,"date":"2022-03-02T09:38:00","date_gmt":"2022-03-02T07:38:00","guid":{"rendered":"https:\/\/lazyadmin.nl\/?p=6142"},"modified":"2022-03-01T15:42:19","modified_gmt":"2022-03-01T13:42:19","slug":"start-transcript","status":"publish","type":"post","link":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/","title":{"rendered":"How to use Start-Transcript in PowerShell"},"content":{"rendered":"\n<p>When running PowerShell scripts automatically you will need a way to log any errors or warnings that occur. One option is to create your own <a href=\"https:\/\/lazyadmin.nl\/powershell\/output-to-file\/#powershell-write-to-log-file\">log function<\/a>, but there is an easier way, the Start-Transcript cmdlet. <\/p>\n\n\n\n<p>The Start-Transcript cmdlet writes everything that happens during a session to a log file. These are the commands that you enter in a PowerShell session and all output that normally appears in the console. You can use this during your normal PowerShell session, but it&#8217;s more useful for creating log files.<\/p>\n\n\n\n<p>In this article, we are going to take a look at how to use the Start-Transcript cmdlet.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Start-Transcript in PowerShell<\/h2>\n\n\n\n<p>The Start-Transcript cmdlet in PowerShell is pretty straightforward to use. It only comes with a couple of parameters and by default, you don&#8217;t even have to specify a file path.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Parameter<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>-Path<\/td><td>Location of the transcript (log) file<\/td><\/tr><tr><td>-Append<\/td><td>Append content to an existing file<\/td><\/tr><tr><td>-Force<\/td><td>Overwrite files with Read-only flag<\/td><\/tr><tr><td>-NoClobber<\/td><td>Prevent overwriting of existing files<\/td><\/tr><tr><td>-IncludeInvocationHeader<\/td><td>Add the timestamp to a command in the log file<\/td><\/tr><tr><td>-UseMinimalHeader<\/td><td>Prepend a short header instead of the full header (PS6+)<\/td><\/tr><tr><td>-OutputDirectory<\/td><td>Specify the output directory (filename will be created automatically)<\/td><\/tr><\/tbody><\/table><figcaption>Start-Transcript parameters<\/figcaption><\/figure>\n\n\n\n<p>There are two ways to use the Start-Transcript cmdlet in PowerShell. You can either start the transcript in your PowerShell session or include it in your script.<\/p>\n\n\n\n<p>Without any parameters, the transcript will be saved in the user&#8217;s documents folder. The filename will automatically be generated and consists of the device name, random characters followed by a timestamp.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">c:\\users\\name\\documents\\PowerShell_transcript.DEVICENAME.qp9EOTN2.20220301132612.txt<\/pre>\n\n\n\n<p>The random characters ensure that the filename is unique when two PowerShell sessions are started simultaneously.<\/p>\n\n\n\n<p>To start the transcript we can simply use the cmdlet <code>Start-Transcript<\/code>. Then after we have executed the scripts that we want to run, we can stop the transcript with <code>Stop-Transcript<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h40_27.png\" alt=\"start-transcript in PowerShell\" class=\"wp-image-6144\" width=\"797\" height=\"274\" srcset=\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h40_27.png 935w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h40_27-300x103.png 300w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h40_27-768x264.png 768w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h40_27-800x276.png 800w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h40_27-400x138.png 400w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h40_27-50x17.png 50w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><figcaption>Start-Transcript in PowerShell<\/figcaption><\/figure>\n\n\n\n<p>The transcript will contain all the information that you see in the console as well, including a very detailed header with information of the host that you have used:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"830\" height=\"764\" src=\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h41_26.png\" alt=\"Powershell transcript\" class=\"wp-image-6145\" srcset=\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h41_26.png 830w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h41_26-300x276.png 300w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h41_26-768x707.png 768w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h41_26-800x736.png 800w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h41_26-400x368.png 400w, https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/2022-03-01_04h41_26-50x46.png 50w\" sizes=\"(max-width: 830px) 100vw, 830px\" \/><figcaption>PowerShell transcript result<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Path and Output Directory<\/h3>\n\n\n\n<p>The default path is great when you are only using PowerShell on your own machine. But most of the time you want to centralize the log files. There are two options for this, we can use the <code>-Path<\/code> parameter or the <code>-OutputDirectory<\/code> parameter for this.<\/p>\n\n\n\n<p>With path, we will need to specify the full path, including the file name. This is useful when you want to have a single log file for a script and append all the transcripts into a single file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Append the transcript to a mfastatus-result.log file.\nStart-Transcript -Path c:\\logfiles\\mfastatus-result.log -Append\n\n# Or use -NoClobber to prevent overwriting of existing files\nStart-Transcript -Path c:\\logfiles\\mfastatus-result.log -NoClobber<\/pre>\n\n\n\n<p>You can also use the -path parameter without the append, but keep in mind that the Start-Transcript parameter by default will overwrite any existing content in the file.<\/p>\n\n\n\n<p>Another option is to use the <code>-OutputDirectory<\/code> parameter. This way we can specify the directory where we want to store the log file, and allow the cmdlet to create the unique filename.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Start-Transcript -OutputDirectory c:\\temp\\logfiles\n\n# Result:\nTranscript started, output file is c:\\temp\\logfiles\\PowerShell_transcript.WIN11-LAB02.uftVAXsv.20220301045218.txt<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Minimal header<\/h3>\n\n\n\n<p>Each transcript starts with a fully detailed header with information about the host. When using this for logging of scripts that run automatically this information is just a bit too much. In PowerShell 6 and higher, we can use the parameter <code>-UseMinimalHeader<\/code> for this.<\/p>\n\n\n\n<p>This will limit the header information to only a timestamp of when the transcript is started:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Start-Transcript -OutputDirectory c:\\temp\\logfiles -UseMinimalDeader\n\n# Start of transcript with minimalheader\n**********************\nPowerShell transcript start\nStart time: 20220301135543\n**********************<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Include Invocation Header<\/h3>\n\n\n\n<p>The invocation header includes a timestamp before each step or command in the transcript. This is especially useful when you have a large script that takes some time to run.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"6\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Start-Transcript -OutputDirectory c:\\temp\\logfiles -IncludeInvocationHeader\n\n**********************\nTranscript started, output file is c:\\temp\\logfiles\\PowerShell_transcript.WIN11-LAB02.VKwZ2RF5.20220301050111.txt\n**********************\nCommand start time: 20220301050122 \n**********************\nPS C:\\> .\\Temp\\Test-SMTP.ps1<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Use Start-Transcript inside a PowerShell script<\/h2>\n\n\n\n<p>Besides starting the transcript manually from the terminal in PowerShell you can of course also include the cmdlet inside your script. Simply start your PowerShell script with the Start-Transcript and end your script with Stop-Transcript:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Start-Transcript -OutputDirectory c:\\temp\\Logfiles -UseMinimalHeader\n\n# Your script here\n\nStop-Transcript<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>The Start-Transcript cmdlet is a great tool when you are debugging new scripts that run automatically. Personally, I don&#8217;t use it much, I prefer a log function combined with <a href=\"https:\/\/lazyadmin.nl\/powershell\/try-catch-finally\/\">Try-Catch blocks<\/a> for example inside script for better error handling.<\/p>\n\n\n\n<p>When you want to use the transcript to see your command history then keep in mind that you also can use the Get-History cmdlet in PowerShell. This will show all commands that you have entered during your PowerShell Session.<\/p>\n\n\n\n<p>If you have any questions, then just drop a comment below.<\/p>\n<script async src=\"https:\/\/alatus.eocampaign1.com\/form\/d0ce5de8-9b48-11ee-8cf4-eb425eea7369.js\" data-form=\"d0ce5de8-9b48-11ee-8cf4-eb425eea7369\"><\/script>","protected":false},"excerpt":{"rendered":"<p>When running PowerShell scripts automatically you will need a way to log any errors or warnings that occur. One option is to create your own log function, but there is an easier way, the Start-Transcript cmdlet. The Start-Transcript cmdlet writes &#8230; <a title=\"How to use Start-Transcript in PowerShell\" class=\"read-more\" href=\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/\">Read more<span class=\"screen-reader-text\">How to use Start-Transcript in PowerShell<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":6146,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[69],"tags":[22],"class_list":["post-6142","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-powershell"],"wppr_data":{"cwp_meta_box_check":"No"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use Start-Transcript in PowerShell &#8212; LazyAdmin<\/title>\n<meta name=\"description\" content=\"Write all console output directly to a log file with Start-Transcript in PowerShell. Automatically create logs from every script that your run\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use Start-Transcript in PowerShell &#8212; LazyAdmin\" \/>\n<meta property=\"og:description\" content=\"Write all console output directly to a log file with Start-Transcript in PowerShell. Automatically create logs from every script that your run\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/\" \/>\n<meta property=\"og:site_name\" content=\"LazyAdmin\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/lazyadminnl\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/lazyadminnl\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-02T07:38:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rudy Mens\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/lazyadmin\" \/>\n<meta name=\"twitter:site\" content=\"@lazyadmin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rudy Mens\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/\"},\"author\":{\"name\":\"Rudy Mens\",\"@id\":\"https:\/\/lazyadmin.nl\/#\/schema\/person\/cbfba61543b21fbba63cfbf62f08d952\"},\"headline\":\"How to use Start-Transcript in PowerShell\",\"datePublished\":\"2022-03-02T07:38:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/\"},\"wordCount\":716,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\/\/lazyadmin.nl\/#\/schema\/person\/cbfba61543b21fbba63cfbf62f08d952\"},\"image\":{\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg\",\"keywords\":[\"Powershell\"],\"articleSection\":[\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/\",\"url\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/\",\"name\":\"How to use Start-Transcript in PowerShell &#8212; LazyAdmin\",\"isPartOf\":{\"@id\":\"https:\/\/lazyadmin.nl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg\",\"datePublished\":\"2022-03-02T07:38:00+00:00\",\"description\":\"Write all console output directly to a log file with Start-Transcript in PowerShell. Automatically create logs from every script that your run\",\"breadcrumb\":{\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#primaryimage\",\"url\":\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg\",\"contentUrl\":\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg\",\"width\":800,\"height\":450},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/lazyadmin.nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use Start-Transcript in PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lazyadmin.nl\/#website\",\"url\":\"https:\/\/lazyadmin.nl\/\",\"name\":\"LazyAdmin\",\"description\":\"Tips and howto&#039;s about Office 365, PowerShell, Home network and smart devices\",\"publisher\":{\"@id\":\"https:\/\/lazyadmin.nl\/#\/schema\/person\/cbfba61543b21fbba63cfbf62f08d952\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lazyadmin.nl\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/lazyadmin.nl\/#\/schema\/person\/cbfba61543b21fbba63cfbf62f08d952\",\"name\":\"Rudy Mens\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lazyadmin.nl\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2024\/06\/Profile-photo-2024-Ruud.jpg\",\"contentUrl\":\"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2024\/06\/Profile-photo-2024-Ruud.jpg\",\"width\":500,\"height\":500,\"caption\":\"Rudy Mens\"},\"logo\":{\"@id\":\"https:\/\/lazyadmin.nl\/#\/schema\/person\/image\/\"},\"description\":\"Ruud worked for more than 15 years as a SysAdmin in the Netherlands and is now working as an independent consultant. In his spare time, he loves to thinker with Smart Devices.\",\"sameAs\":[\"https:\/\/lazyadmin.nl\",\"https:\/\/www.facebook.com\/lazyadminnl\/\",\"http:\/\/nl.linkedin.com\/in\/rudymens\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/lazyadmin\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use Start-Transcript in PowerShell &#8212; LazyAdmin","description":"Write all console output directly to a log file with Start-Transcript in PowerShell. Automatically create logs from every script that your run","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/","og_locale":"en_US","og_type":"article","og_title":"How to use Start-Transcript in PowerShell &#8212; LazyAdmin","og_description":"Write all console output directly to a log file with Start-Transcript in PowerShell. Automatically create logs from every script that your run","og_url":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/","og_site_name":"LazyAdmin","article_publisher":"https:\/\/www.facebook.com\/lazyadminnl\/","article_author":"https:\/\/www.facebook.com\/lazyadminnl\/","article_published_time":"2022-03-02T07:38:00+00:00","og_image":[{"width":800,"height":450,"url":"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg","type":"image\/jpeg"}],"author":"Rudy Mens","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/lazyadmin","twitter_site":"@lazyadmin","twitter_misc":{"Written by":"Rudy Mens","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#article","isPartOf":{"@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/"},"author":{"name":"Rudy Mens","@id":"https:\/\/lazyadmin.nl\/#\/schema\/person\/cbfba61543b21fbba63cfbf62f08d952"},"headline":"How to use Start-Transcript in PowerShell","datePublished":"2022-03-02T07:38:00+00:00","mainEntityOfPage":{"@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/"},"wordCount":716,"commentCount":5,"publisher":{"@id":"https:\/\/lazyadmin.nl\/#\/schema\/person\/cbfba61543b21fbba63cfbf62f08d952"},"image":{"@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#primaryimage"},"thumbnailUrl":"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg","keywords":["Powershell"],"articleSection":["PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/","url":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/","name":"How to use Start-Transcript in PowerShell &#8212; LazyAdmin","isPartOf":{"@id":"https:\/\/lazyadmin.nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#primaryimage"},"image":{"@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#primaryimage"},"thumbnailUrl":"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg","datePublished":"2022-03-02T07:38:00+00:00","description":"Write all console output directly to a log file with Start-Transcript in PowerShell. Automatically create logs from every script that your run","breadcrumb":{"@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lazyadmin.nl\/powershell\/start-transcript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#primaryimage","url":"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg","contentUrl":"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg","width":800,"height":450},{"@type":"BreadcrumbList","@id":"https:\/\/lazyadmin.nl\/powershell\/start-transcript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lazyadmin.nl\/"},{"@type":"ListItem","position":2,"name":"How to use Start-Transcript in PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/lazyadmin.nl\/#website","url":"https:\/\/lazyadmin.nl\/","name":"LazyAdmin","description":"Tips and howto&#039;s about Office 365, PowerShell, Home network and smart devices","publisher":{"@id":"https:\/\/lazyadmin.nl\/#\/schema\/person\/cbfba61543b21fbba63cfbf62f08d952"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lazyadmin.nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/lazyadmin.nl\/#\/schema\/person\/cbfba61543b21fbba63cfbf62f08d952","name":"Rudy Mens","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lazyadmin.nl\/#\/schema\/person\/image\/","url":"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2024\/06\/Profile-photo-2024-Ruud.jpg","contentUrl":"https:\/\/lazyadmin.nl\/wp-content\/uploads\/2024\/06\/Profile-photo-2024-Ruud.jpg","width":500,"height":500,"caption":"Rudy Mens"},"logo":{"@id":"https:\/\/lazyadmin.nl\/#\/schema\/person\/image\/"},"description":"Ruud worked for more than 15 years as a SysAdmin in the Netherlands and is now working as an independent consultant. In his spare time, he loves to thinker with Smart Devices.","sameAs":["https:\/\/lazyadmin.nl","https:\/\/www.facebook.com\/lazyadminnl\/","http:\/\/nl.linkedin.com\/in\/rudymens\/","https:\/\/x.com\/https:\/\/twitter.com\/lazyadmin"]}]}},"uagb_featured_image_src":{"full":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg",800,450,false],"thumbnail":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript-150x150.jpg",150,150,true],"medium":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript-300x169.jpg",300,169,true],"medium_large":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript-768x432.jpg",768,432,true],"large":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg",800,450,false],"1536x1536":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg",800,450,false],"2048x2048":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg",800,450,false],"post-thumb":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg",800,450,false],"post-thumb-half":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript-400x225.jpg",400,225,true],"wppr-widget":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript-50x28.jpg",50,28,true],"gform-image-choice-sm":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg",300,169,false],"gform-image-choice-md":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg",400,225,false],"gform-image-choice-lg":["https:\/\/lazyadmin.nl\/wp-content\/uploads\/2022\/03\/Start-Transcript.jpg",600,338,false]},"uagb_author_info":{"display_name":"Rudy Mens","author_link":"https:\/\/lazyadmin.nl\/author\/lajcud8123b\/"},"uagb_comment_info":5,"uagb_excerpt":"When running PowerShell scripts automatically you will need a way to log any errors or warnings that occur. One option is to create your own log function, but there is an easier way, the Start-Transcript cmdlet. The Start-Transcript cmdlet writes ... Read moreHow to use Start-Transcript in PowerShell","_links":{"self":[{"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/posts\/6142"}],"collection":[{"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/comments?post=6142"}],"version-history":[{"count":0,"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/posts\/6142\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/media\/6146"}],"wp:attachment":[{"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/media?parent=6142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/categories?post=6142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lazyadmin.nl\/wp-json\/wp\/v2\/tags?post=6142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}