Check in SharePoint Document Library using PowerShell

 To  Check -in a SharePoint Document library, we can use the following power shell commands:
 
$fileName = "myFile.docx"
$myWeb = Get-SPWeb "http://mysite/testsite"
$myLib = $myWeb.GetFolder("DocLib")
$myFile = $myLib.Files | ? {$_.name -eq $fileName}
$myFile.CheckIn("Comment")
$myFile.UndoCheckOut()
$myFile.Update()