{"id":34526,"date":"2024-01-30T17:08:04","date_gmt":"2024-01-30T22:08:04","guid":{"rendered":"https:\/\/bhargavs.com\/?p=34526"},"modified":"2024-01-30T17:11:06","modified_gmt":"2024-01-30T22:11:06","slug":"clearing-microsoft-teams-cache-with-powershell","status":"publish","type":"post","link":"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/","title":{"rendered":"Clearing Microsoft Teams Cache with PowerShell"},"content":{"rendered":"<h1>Introduction<\/h1>\n<p>I recently came across a need to clear Teams cache. While the task might be simple, I ended up spending a little more time to address the scenarios I can foresee so the PowerShell script is more useful that a single use case.<\/p>\n<p>In this blog post, we&#8217;ll be examining this script and also highlight how I applied PowerShell best practices in the process.<\/p>\n<h2>Code Overview<\/h2>\n<p>The script begins with a comment block that provides a synopsis, description, parameters, example usage, disclaimer, and notes about the script. This is a common practice in PowerShell to provide detailed information about what the script does, how to use it, and who authored it.<\/p>\n<blockquote><p>&lt;#<br \/>\n.SYNOPSIS<br \/>\nClears the cache for Microsoft Teams (New Client).<br \/>\n&#8230;<br \/>\n.NOTES<br \/>\nAuthor: Bhargav Shukla<br \/>\nDate: 01\/29\/2024<br \/>\n#&gt;<\/p><\/blockquote>\n<h2>Parameters<\/h2>\n<p>The use of parameters in the script allows users to customize its behavior. This is a best practice in PowerShell as it makes scripts more flexible and reusable. The parameters are defined using the `param` keyword and include default values, another best practice as it makes the script easier to use and more robust.<\/p>\n<blockquote><p>param (<br \/>\n[bool]$cacheCleared = $false,<br \/>\n[string]$logFilePath = &#8220;C:\\Logs\\CacheLog.txt&#8221;,<br \/>\n[string]$errorFilePath = &#8220;C:\\Logs\\ErrorLog.txt&#8221;<br \/>\n)<\/p><\/blockquote>\n<h2>PowerShell Best Practices in the Code<\/h2>\n<p>1. **Commenting**: The script begins with a comprehensive comment block that provides a synopsis, description, parameters, example usage, disclaimer, and notes about the script. This is a best practice as it makes the script self-documenting, which is crucial for maintenance and collaboration.<\/p>\n<p>3. **Default Parameter Values**: The parameters are defined with default values. This is a best practice as it makes the script easier to use and more robust. It also provides a fallback in case the user does not provide a value.<\/p>\n<p>4. **Data Types**: The script specifies the data types for each parameter (`bool` for `$cacheCleared` and `string` for `$logFilePath` and `$errorFilePath`). This is a best practice as it ensures that the script receives the correct types of data.<\/p>\n<p>5. **Code Reusability**: The script uses functions and variables to avoid repeating code and optimize script structure as well.<\/p>\n<h2>Complete Script<\/h2>\n<div>\n<pre lang=\"PowerShell\" line=\"1\"><#\r\n.SYNOPSIS\r\nClears the cache for Microsoft Teams (New Client).\r\n\r\n.DESCRIPTION\r\nThis script sets the variable $cacheCleared to $false, indicating that the cache has not been cleared yet.\r\n\r\n.PARAMETER cacheCleared\r\nA boolean variable that indicates whether the cache has been cleared or not.\r\n\r\n.PARAMETER logFilePath\r\nSpecifies the path where the log file will be created.\r\n\r\n.PARAMETER errorFilePath\r\nSpecifies the path where the error file will be created.\r\n\r\n.EXAMPLE\r\nClear-NewTeamsCache.ps1 -logFilePath \"C:\\Logs\\CacheLog.txt\" -errorFilePath \"C:\\Logs\\ErrorLog.txt\"\r\nClears the cache for Microsoft Teams and creates a log file at the specified path.\r\n\r\n.DISCLAIMER\r\nThis script is provided as-is without any warranty or support. Use it at your own risk.\r\nThe author and Microsoft shall not be liable for any damages or losses arising from the use of this script.\r\n\r\n.NOTES\r\nAuthor: Bhargav Shukla\r\nDate: 01\/29\/2024\r\n#>\r\n\r\nparam (\r\n    [bool]$cacheCleared = $false,\r\n    [string]$logFilePath = \"C:\\Logs\\CacheLog.txt\",\r\n    [string]$errorFilePath = \"C:\\Logs\\ErrorLog.txt\"\r\n)\r\n\r\n# Define cache folder paths\r\n$newCacheFolder = \"$env:userprofile\\appdata\\local\\Packages\\MSTeams_8wekyb3d8bbwe\\LocalCache\\Microsoft\\MSTeams\"\r\n$classicCacheFolder = \"$env:userprofile\\appdata\\roaming\\Microsoft\\Teams\"\r\n\r\n# Function to create a file if it doesn't exist\r\nfunction Create-FileIfNotExists {\r\n    param (\r\n        [string]$filePath\r\n    )\r\n\r\n    if (-not (Test-Path -Path $filePath)) {\r\n        New-Item -Path $filePath -ItemType File -Force | Out-Null\r\n    }\r\n}\r\n\r\n# Function to clear cache\r\nfunction Clear-Cache {\r\n    param (\r\n        [string]$cacheFolder\r\n    )\r\n\r\n    Remove-Item -Path $cacheFolder\\* -Force -Recurse\r\n    Write-Host \"Cache cleared from $cacheFolder\"\r\n    Add-Content -Path $logFilePath -Value \"$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Cache cleared from $cacheFolder\"\r\n}\r\n\r\n# Create log and error files if they don't exist\r\nCreate-FileIfNotExists -filePath $logFilePath\r\nCreate-FileIfNotExists -filePath $errorFilePath\r\n\r\n# Prompt user to clear cache or defer\r\n$choice = Read-Host \"Do you want to clear the Teams cache now? (Y\/N)\"\r\n\r\nif ($choice -eq \"Y\" -or $choice -eq \"y\") {\r\n    try {\r\n        # Check which version of Teams client is running\r\n        $teamsProcess = Get-Process -Name \"MS-Teams\" -ErrorAction SilentlyContinue\r\n        if ($teamsProcess -eq $null) {\r\n            $teamsProcess = Get-Process -Name \"Teams\" -ErrorAction SilentlyContinue\r\n        }\r\n\r\n        if ($teamsProcess -ne $null) {\r\n            # Quit Teams application\r\n            Stop-Process -Id $teamsProcess.Id -Force\r\n\r\n            # Delete cache files based on the client version\r\n            if ($teamsProcess.Name -eq \"MS-Teams\") {\r\n                Clear-Cache -cacheFolder $newCacheFolder\r\n            }\r\n            else {\r\n                Clear-Cache -cacheFolder $classicCacheFolder\r\n            }\r\n\r\n            # Notify user to start Teams\r\n            Write-Host \"Teams cache cleared. You can now start Teams.\"\r\n\r\n            # Log the action\r\n            Add-Content -Path $logFilePath -Value \"$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') Cache Cleared\"\r\n        }\r\n        else {\r\n            # Clear cache if Teams is not running\r\n            $clientMessage = \"Teams application is not running.\"\r\n            Write-Host $clientMessage\r\n            Add-Content -Path $logFilePath -Value \"$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - $clientMessage\"\r\n\r\n            # Verify existence of cache folder(s) and clear cache\r\n            if (Test-Path -Path $newCacheFolder) {\r\n                Clear-Cache -cacheFolder $newCacheFolder\r\n            }\r\n            else {\r\n                Clear-Cache -cacheFolder $classicCacheFolder\r\n            }\r\n        }\r\n    }\r\n    catch {\r\n        # Log error if cache clearing fails\r\n        $errorMessage = \"Failed to clear cache. Error: $($_.Exception.Message)\"\r\n        Write-Host $errorMessage\r\n        Add-Content -Path $logFilePath -Value \"$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - $errorMessage\"\r\n    }\r\n    finally {\r\n        # Perform cleanup operations here if needed\r\n    }\r\n}\r\nelse {\r\n    # Log the action\r\n    Add-Content -Path $logFilePath -Value \"$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Cache Clearing Deferred\"\r\n}\r\n<\/pre>\n<h2>Conclusion<\/h2>\n<div>Feel free to update as needed. Make sure to test for your needs before using it in your environment. The script doesn&#8217;t come with any support or warranty. Your feedback is welcome.<\/div>\n<\/div>\n<div>You can download the code here: <a href=\"https:\/\/bhargavs.com\/wp-content\/uploads\/2024\/01\/Clear-TeamsCache.txt\">Clear-TeamsCache.txt<\/a>.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction I recently came across a need to clear Teams cache. While the task might be simple, I ended up spending a little more time to address the scenarios I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[9,19,308],"tags":[309,212],"class_list":["post-34526","post","type-post","status-publish","format-standard","hentry","category-general","category-powershell","category-teams","tag-microsoft-teams","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Clearing Microsoft Teams Cache with PowerShell - Bhargav&#039;s IT Playground<\/title>\n<meta name=\"description\" content=\"Walkthrough of a PowerShell script designed to clear Microsoft Teams cache. Learn how to use the script, understand its parameters, and discover the best practices applied in its creation. Script code and download is available as well.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Clearing Microsoft Teams Cache with PowerShell - Bhargav&#039;s IT Playground\" \/>\n<meta property=\"og:description\" content=\"Walkthrough of a PowerShell script designed to clear Microsoft Teams cache. Learn how to use the script, understand its parameters, and discover the best practices applied in its creation. Script code and download is available as well.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Bhargav&#039;s IT Playground\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-30T22:08:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-30T22:11:06+00:00\" \/>\n<meta name=\"author\" content=\"Bhargav\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bhargav\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2024\\\/01\\\/30\\\/clearing-microsoft-teams-cache-with-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2024\\\/01\\\/30\\\/clearing-microsoft-teams-cache-with-powershell\\\/\"},\"author\":{\"name\":\"Bhargav\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"headline\":\"Clearing Microsoft Teams Cache with PowerShell\",\"datePublished\":\"2024-01-30T22:08:04+00:00\",\"dateModified\":\"2024-01-30T22:11:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2024\\\/01\\\/30\\\/clearing-microsoft-teams-cache-with-powershell\\\/\"},\"wordCount\":392,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"keywords\":[\"Microsoft Teams\",\"PowerShell\"],\"articleSection\":[\"General\",\"PowerShell\",\"Teams\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2024\\\/01\\\/30\\\/clearing-microsoft-teams-cache-with-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2024\\\/01\\\/30\\\/clearing-microsoft-teams-cache-with-powershell\\\/\",\"url\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2024\\\/01\\\/30\\\/clearing-microsoft-teams-cache-with-powershell\\\/\",\"name\":\"Clearing Microsoft Teams Cache with PowerShell - Bhargav&#039;s IT Playground\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#website\"},\"datePublished\":\"2024-01-30T22:08:04+00:00\",\"dateModified\":\"2024-01-30T22:11:06+00:00\",\"description\":\"Walkthrough of a PowerShell script designed to clear Microsoft Teams cache. Learn how to use the script, understand its parameters, and discover the best practices applied in its creation. Script code and download is available as well.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2024\\\/01\\\/30\\\/clearing-microsoft-teams-cache-with-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2024\\\/01\\\/30\\\/clearing-microsoft-teams-cache-with-powershell\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2024\\\/01\\\/30\\\/clearing-microsoft-teams-cache-with-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/bhargavs.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Clearing Microsoft Teams Cache with PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#website\",\"url\":\"https:\\\/\\\/bhargavs.com\\\/\",\"name\":\"Bhargav's IT Playground\",\"description\":\"Passion for Technology. Power of Collaboration.\",\"publisher\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/bhargavs.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\",\"name\":\"Bhargav\",\"logo\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/bhargavs.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Clearing Microsoft Teams Cache with PowerShell - Bhargav&#039;s IT Playground","description":"Walkthrough of a PowerShell script designed to clear Microsoft Teams cache. Learn how to use the script, understand its parameters, and discover the best practices applied in its creation. Script code and download is available as well.","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:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Clearing Microsoft Teams Cache with PowerShell - Bhargav&#039;s IT Playground","og_description":"Walkthrough of a PowerShell script designed to clear Microsoft Teams cache. Learn how to use the script, understand its parameters, and discover the best practices applied in its creation. Script code and download is available as well.","og_url":"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/","og_site_name":"Bhargav&#039;s IT Playground","article_published_time":"2024-01-30T22:08:04+00:00","article_modified_time":"2024-01-30T22:11:06+00:00","author":"Bhargav","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Bhargav","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/#article","isPartOf":{"@id":"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/"},"author":{"name":"Bhargav","@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"headline":"Clearing Microsoft Teams Cache with PowerShell","datePublished":"2024-01-30T22:08:04+00:00","dateModified":"2024-01-30T22:11:06+00:00","mainEntityOfPage":{"@id":"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/"},"wordCount":392,"commentCount":0,"publisher":{"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"keywords":["Microsoft Teams","PowerShell"],"articleSection":["General","PowerShell","Teams"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/","url":"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/","name":"Clearing Microsoft Teams Cache with PowerShell - Bhargav&#039;s IT Playground","isPartOf":{"@id":"https:\/\/bhargavs.com\/#website"},"datePublished":"2024-01-30T22:08:04+00:00","dateModified":"2024-01-30T22:11:06+00:00","description":"Walkthrough of a PowerShell script designed to clear Microsoft Teams cache. Learn how to use the script, understand its parameters, and discover the best practices applied in its creation. Script code and download is available as well.","breadcrumb":{"@id":"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/bhargavs.com\/index.php\/2024\/01\/30\/clearing-microsoft-teams-cache-with-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bhargavs.com\/"},{"@type":"ListItem","position":2,"name":"Clearing Microsoft Teams Cache with PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/bhargavs.com\/#website","url":"https:\/\/bhargavs.com\/","name":"Bhargav's IT Playground","description":"Passion for Technology. Power of Collaboration.","publisher":{"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bhargavs.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26","name":"Bhargav","logo":{"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/bhargavs.com"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1670,"url":"https:\/\/bhargavs.com\/index.php\/2011\/08\/22\/microsoft-exchange-2010-powershell-cookbook-review\/","url_meta":{"origin":34526,"position":0},"title":"Microsoft Exchange 2010 PowerShell Cookbook Review","author":"Bhargav","date":"August 22, 2011","format":false,"excerpt":"Disclaimer: I am not paid to write about this book and the review written here is my own view. I was recently contacted by Packt Publishing about their recently published book \u201cMicrosoft Exchange 2010 PowerShell Cookbook\u201d. I have voluntarily reviewed books in the past (i.e. Windows Server 2003 Security: A\u2026","rel":"","context":"In &quot;Exchange 2010&quot;","block_context":{"text":"Exchange 2010","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2010\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1650,"url":"https:\/\/bhargavs.com\/index.php\/2010\/03\/29\/script-to-enable-preview-pane-for-powershell-scripts\/","url_meta":{"origin":34526,"position":1},"title":"Script to enable preview pane for PowerShell scripts","author":"Bhargav","date":"March 29, 2010","format":false,"excerpt":"If you are running Windows 7, you probably know what preview pane is. And if you use PowerShell and create ps1 scripts, you may also wonder how can you enable preview for PowerShell scripts in Windows Explorer. Well, Nate Bruneau shared how to edit registry to enable preview for ps1\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1653,"url":"https:\/\/bhargavs.com\/index.php\/2010\/07\/28\/how-to-convert-a-word-document-to-other-formats-using-powershell\/","url_meta":{"origin":34526,"position":2},"title":"How to convert a word document to other formats using PowerShell","author":"Bhargav","date":"July 28, 2010","format":false,"excerpt":"I recently borrowed a Sony Reader Touch Edition from someone I know to try it out. As I started using Sony\u2019s own library manager, I quickly got bored. I then tried open source Calibre which turned out to be a lot better interface but had a major flaw when it\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1673,"url":"https:\/\/bhargavs.com\/index.php\/2011\/10\/21\/powershell-script-to-edit-remote-registry\/","url_meta":{"origin":34526,"position":3},"title":"PowerShell script to edit remote registry","author":"Bhargav","date":"October 21, 2011","format":false,"excerpt":"Did you ever wanted to modify your registry or add a key\/value pair to registry? Wished there was a script to help you do that? Even better, wished it can run remotely without PowerShell WinRM listener configured on target server? I had custom script that would modify certain registry entry\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1632,"url":"https:\/\/bhargavs.com\/index.php\/2009\/08\/17\/exchange-2007-powershell-scripts\/","url_meta":{"origin":34526,"position":4},"title":"Exchange 2007 PowerShell Scripts \u2013 What would you like to script?","author":"Bhargav","date":"August 17, 2009","format":false,"excerpt":"I am always thinking about how can I script\/automate tasks I have to do repeatedly or I see others ask for. I would like to go a step beyond. I would like to ask you \u2013 the readers: If you would want to script something for your Exchange 2007 environment,\u2026","rel":"","context":"In &quot;Announcements&quot;","block_context":{"text":"Announcements","link":"https:\/\/bhargavs.com\/index.php\/category\/announcements\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1701,"url":"https:\/\/bhargavs.com\/index.php\/2013\/08\/30\/book-review-microsoft-exchange-server-2013-powershell-cookbook-second-edition\/","url_meta":{"origin":34526,"position":5},"title":"Book Review &#8211; Microsoft Exchange Server 2013 PowerShell Cookbook (Second Edition)","author":"Bhargav","date":"August 30, 2013","format":false,"excerpt":"Among other books that I have reviewed in past, I had pleasure reviewing Mike\u2019s \u201cMicrosoft Exchange 2010 PowerShell Cookbook\u201d when it was release in 2011. So, when PACKT Publishing asked me if I would be interested in reviewing his new book \u201cMicrosoft Exchange Server 2013 PowerShell Cookbook: Second Edition\u201d, I\u2026","rel":"","context":"In &quot;Book Review&quot;","block_context":{"text":"Book Review","link":"https:\/\/bhargavs.com\/index.php\/category\/book-review\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_shortlink":"https:\/\/wp.me\/pkROc-8YS","_links":{"self":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts\/34526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/comments?post=34526"}],"version-history":[{"count":12,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts\/34526\/revisions"}],"predecessor-version":[{"id":34539,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts\/34526\/revisions\/34539"}],"wp:attachment":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/media?parent=34526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/categories?post=34526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/tags?post=34526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}