Hello Sir !
Pls, How render the result after I have us the switch parameter?
All works perfect! but the last have en error, but i don't see him ...
cls
""
$xval1 = (Get-Date).dayofyear
$xval1 = $xval1 | % {($_.Length)}
switch ($xval1)
{
1 {$XDay_of_Earth_Year = " " + (Get-Date).dayofyear + "."}
2 {$XDay_of_Earth_Year = " " + (Get-Date).dayofyear + "."}
3 {$XDay_of_Earth_Year = " " + (Get-Date).dayofyear + "."}
}
$XDay_of_Earth_Year
""
$xval2 = ((Get-Date).dayofyear) - (([datetime]'12/31' - [datetime]'1/1') | % days)
switch ($xval2.tostring().Length)
{
1 {$xday_left_year_earth = " " + $xval2 + ". | "}
2 {$xday_left_year_earth = " " + $xval2 + ". | "}
3 {$xday_left_year_earth = " " + $xval2 + ". | "}
4 {$xday_left_year_earth = " " + $xval2 + ". | "}
}
$Xday_left_year_earth
""
$Xvaleur2 = "4"
switch ($Xvaleur2.Length)
{
1 {$xday_month_luna_val = "- " + $Xvaleur2 + ". "}
2 {$xday_month_luna_val = "- " + $Xvaleur2 + ". "}
}
$xday_month_luna_val
""
$Xvaleur3 = "8"
switch ($Xvaleur3.Length)
{
1 {$Xluna_month_val = "- " + $Xvaleur3 + ". "}
2 {$Xluna_month_val = "- " + $Xvaleur3 + ". "}
}
$Xluna_month_val
""
"==================================================="
$Xdate_day = Get-Date -Format %d
""
$Xdate_day.Length # " now, 2 length is okay !!!!!"
switch ($Xdat)
{
1 {$Xday_earth = " - " + [string]$Xdate_day } # le 19
2 {$Xday_earth = " - " + [string]$Xdate_day }
}
""
$Xday_earth
""" day_earth is not match """
"==================================================="
""
clear-variable X* -scope global -Force
The result is:
292.
-72. |
- 4.
- 8.
===================================================
2
" day_earth is not match "
===================================================
rapport-luna-earth.txt
Thank for your Help
Arnold