Return to site

Open file in powershell

broken image
broken image
broken image

This cmdlet is also working properly in Command Prompt (CMD) Method 2. PS C:\Users\spfarm> start c:\debug.to.txt. item ( $SheetName ) [ ordered ComputerName = $WorkSheet. How to Open File from PowerShell and Command-Line To open a file regardless of its type/extension, you can use one of the below methods: Method 1. Open ( $FilePath ) # Load the WorkSheet 'BuildSpecs' $WorkSheet = $WorkBook. Visible = $false # Open the Excel file and save it in $WorkBook $WorkBook = $objExcel. #Specify the path of the excel file $FilePath = 'C:\LazyWinAdmin\VIDEOSERVER01-BuildSpecs.xlsx' #Specify the Sheet name $SheetName = 'BuildSpecs' # Create an Object Excel.Application using Com interface $objExcel = New-Object -ComObject Excel.Application # Disable the 'visible' property so the document won't open in excel $objExcel.