Tag Archives: powershell

executing a Powershell script from php

Questions: I’m trying to execute a powershell script from PHP, but it does not seem to work. The script ‘newEvent.ps1’ creates an event on the Exchange server. $psPath = “powershell.exe”; $psDIR = “C:\\wamp\\www\\ant\\assets\\ps\\”; $psScript = “newEvent.ps1″; $runScript = $psDIR. $psScript; $runCMD = $psPath.” “.$runScript.” 2>&1″; echo “\$psPath $psPath <br>”; echo “\$psDIR $psDIR <br>”; echo “\$psScript… Read More »

Excel COM Object in PowerShell

Questions: SharePoint Online has a mostly undocumented method of populating a list of SharePoint Online sites that an administrator pushes out to its users. Based on the presence/values of some registry keys, the client workstation knows when to ask SharePoint Online for an updated list of the SharePoint sites. The problem I’m having is that… Read More »

Powershell paste data into existing sheet

Questions: I have a script that takes data from an existing .csv file and copies into an existing workbook (xlsx). The problem: It always creates a new sheet in the workbook. I would like to add the data to my current sheet and start at A5 instead of the top. Here is what I have… Read More »

powershell cannot add more than one legend entry (series) to an excel chart

Questions: I have a problem adding more than one series to the seriescollection in excels chart object through powershell here is my code: [threading.thread]::CurrentThread.CurrentCulture = ‘en-US’ $excel = New-Object -comobject Excel.Application $workbook = $excel.workbooks.add() $datasheet = $workbook.Worksheets.Item(2) $chartsheet = $workbook.Worksheets.Item(1) [datetime] $startDate = “2012-11-29 00:00:00” [datetime] $finishDate = “2012-12-07 00:00:00” [datetime] $dayCounter = $startDate $startRow… Read More »

Powershell script using Excel running slow

Questions: So i have this script that i coded on my laptop that works just fine, the job is to combine two .csv-files into one .xls-file. And running the script with two .csv-files containing a couple of thousand rows takes a few seconds max. But when i try to run it on the server where… Read More »