I am using the PowerShell Code below which is working fine .
Only part which was not working is the Hyperlink part . Though it is working fine and giving me the output , I could not open the Hyperlink outside the server where I worked on the code .
Not sure how to change the Hyperlink from C:\TEMP\ location and make it dynamically accessible . Kindly suggest .
Code :
$ok = 80
$NotOk = 90
$ser = @('Serv1','Serv2')
$Out = foreach($s in $ser){
#$Disk = Get-Content C:\temp\Disk.htm
$link = "<a href='c:\temp\disk.htm'>Disk</a> "
Get-WmiObject Win32_Volume -ComputerName $s|`
Where { $_.drivetype -eq '3' -and $_.driveletter} |`
Select-Object SystemName,driveletter,name,label,
@{Name='freespace';Expression={[Int]($_.freespace/1GB)}},
@{Name='capacity';Expression={[Int]($_.capacity/1GB)}},
@{Name='UsedSpace';Expression={"{0:N0}" -f ( $_.capacity/1GB - $_.FreeSpace/1GB )}},
@{Name='UsedSpacePercent';Expression={"{0:N0}" -f (($_.capacity - $_.FreeSpace) / $_.Capacity * 100)}} | `
Where-Object {$_.label -notlike "Recovery" -and $_.name -notlike "*volume*" -and $_.name -notlike "D:\" }}
$Out |select SystemName,DriveLetter,Capacity,usedspacepercent|`
convertto-html -Head $Header -Body " <H2 style=color:#000000;font-family:calibri;text-align:left; >Servers Disk Status $link </h2> "|
Out-File C:\Temp\DatabaseStatusReport_Test.html -Append
NOTE : The files which was hyperlinked can be open in the server without any issues .
The hyperlink variable used is $link
Below is the code and error message .
Once I click on Yes I am getting below message
Please help me how can I make it work .