Posts

Showing posts from April, 2021

How to execute parallel/ Threaded jobs in PowerShell

Image
  Many times we need to work in parallel when executing the Powershell commands. Today in this post I will tell how we can execute the commands in parallel.  In my case, I have used these parallel jobs for the migration of SharePoint On-Prem to SharePoint Online using Sharegate, executing multiple instances and then monitoring those instances to initiate as soon as any of the instances is finished executing. Step 1: Installing the Module To leverage the benefit of the parallel jobs, we need to install the Module so to install the module, execute the following command Install-Module   - Name  " ThreadJob "   - Scope AllUsers Once the module is installed, then you are ready to go. Step 2: Execute Parallel Jobs Now you can start parallel jobs in the background. Here is the sample for executing the parallel jobs $Job  =   Start-ThreadJob   - FilePath  " .\PowershellScript.ps1 "   - ArgumentList  @ ($param1, $param2)  - Name 

How to stop computer from sleeping

Image
  This is a very generic post, but I felt though this is small thing but can be of good use. So, many times we do run the PowerShell scripts or some processing on our local computer and it is blocked due to the system entering into sleep mode. Due to which the process gets stopped. There are third-party apps for this but do not rely on installing many 3rd party apps to my system. So I found the script which does the job for me. I know what's written in the script so I am confident while running this script. Here is the script, Clear-Host $myshell  =   New-Object   - com  " Wscript.Shell " while  ( $true ) {      Write-Host  ([ char ] 9829 )  - ForegroundColor Red  - NoNewline     $myshell.sendkeys( " . " )      Start-Sleep   - Seconds  300 } Hope this will help you as well, do comment and share if you like it. Happy Coding..!! Sumit Kanchan

Alternative to Discussion list in SharePoint Online

Image
  In SharePoint Online one of the most missed features from the legacy system is the ability to create discussion forums. Since we do not have the OOB functionality, but we still can achieve it using the OOB features. In this post, I will show you how you can create the discussion forums using OOB features and with a more attractive UI.  Let's start and set up the discussion Forum. STEP 1: Create necessary columns in Site Pages Library To Achieve the functionality, I have made use of the "Site Pages" Library as it gives you the OOB ability to comment and like on the page. In order to make it fully usable, we will create a column  PageType: This will tell us whether the page created is a discussion or the page Values: Page, Discussion STEP 2: Create Custom View Create a View (in my case I have created the view by the name Discussion),