Hi,
What exactly are you looking for? I doubt there's any utility that will take a prewritten PowerShell script and spit out a working PHP script.
- Edited by bentek.nyc 14 hours 50 minutes ago
- Edited by bentek.nyc 14 hours 43 minutes ago
Okay thanks for all the replies and sorry for the confusion. At the moment I have a script that outputs some WOL info to a html file:
$body = ConvertTo-Html -head $head -body "$($body)<H1>$Name</H1><H2>Wake on lan Report as of $end </H2>$($html)"| Out-String $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($False) [System.IO.File]::WriteAllLines($webfile, $body, $Utf8NoBomEncoding)
So it outputs it as a html file. Truly all I want is for the file extension to be .php instead of .html. Is this possible? Thanks!
I think this works:
Rename-Item -Path test.html -NewName test.php
I was just hoping there was a way to output it directly as a php file instead of html. Thanks.
As Leif points out, that is only a subset of the script. Since you are doing
[System.IO.File]::WriteAllLines($webfile, $body, $Utf8NoBomEncoding)
I will assume $webFile is something like
$webFile = "C:\myFiles\myfile.html"Why not just change the extension to php? ConverTo-Html, just creates the HTML markup for you, you are the one that is creating the html extension for the file.
You're right I'm sorry I though it was creating the .html file without me specifying. So all I needed to do is change:
$webfile = "$($rootDir)WakeOnLanReport$($Area).html"
to
$webfile = "$($rootDir)WakeOnLanReport$($Area).php"
Sorry guys I had a major brain fart. Thanks for the help though!!
A PHP web server executes (delivers) HTML with no issues. You only need a PHP extension when you want to embed server side code. Same with ASP.
Sorry guys I had a major brain fart. Thanks for the help though!!No need to apologize, we've all done that before. Glad it worked out in the end.
Sorry guys I had a major brain fart. Thanks for the help though!!
No need to apologize, we've all done that before. Glad it worked out in the
- Edited by bentek.nyc Friday, July 10, 2015 4:19 PM