Question cmd en powershell

Plus d'informations
il y a 10 ans 11 mois #20250 par Doni
cmd en powershell a été créé par Doni
Bonjour à tous,

Je suis débutant en powershell et je cherche de mettre un vieux script cmd en powershell.

Pouvez vous m'aider à traduire ce script:


Par avance un grand merci à ceux qui ce pencheront sur mon problème


La pièce jointe new__1.txt est absente ou indisponible

Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 10 ans 11 mois #20259 par Tony Thoumassin
Réponse de Tony Thoumassin sur le sujet Re:cmd en powershell
[code:1]#initialisation des variables en sachant que $pathlog contient le chemin où est situé le script.
$PATHLOG = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent
$File = $PATHLOG + \"\check_bi4_servers_status.txt\"
$filehist = $PATHLOG + \"\check_bi4_servers_status_historique.txt\"
$file1 = $PATHLOG + \"\check_bi4_servers_status_tmp1.txt\"
$file2 = $PATHLOG + \"\check_bi4_servers_status_tmp2.txt\"

#je fais tous les test d'existence ou non des fichier.
if ((Test-Path -Path \"C:\Exploit\Scripts\logs\FileTE_TMP2.CentralManagementServer.txt\"«») -eq $true)
{
Remove-Item -Path \"C:\Exploit\Scripts\logs\FileTE_TMP2.CentralManagementServer.txt\"
}
if ((Test-Path -Path \"C:\Exploit\Scripts\logs\FileTE_TMP2.CrystalReportsCacheServer.txt\"«») -eq $true)
{
Remove-Item -Path \"C:\Exploit\Scripts\logs\FileTE_TMP2.CrystalReportsCacheServer.txt\"
}
if ((Test-Path -Path \"C:\Exploit\Scripts\logs\FileTE_TMP2.CrystalReports2013ProcessingServer.txt\"«») -eq $true)
{
Remove-Item -Path \"C:\Exploit\Scripts\logs\FileTE_TMP2.CrystalReports2013ProcessingServer.txt\"
}
if ((Test-Path -Path \"C:\Exploit\Scripts\logs\FileTE_TMP2.EventServer.txt\"«») -eq $true)
{
Remove-Item -Path \"C:\Exploit\Scripts\logs\FileTE_TMP2.EventServer.txt\"
}[/code:1]

Voilà le début après j'y connais rien en cmd donc je suis pas d'une grande aide. Sinon les echo sont des Write-Host et pour les for c'est comme ça
[code:1]for ($i=start; $i -lt end; $i++) {

}[/code:1]

Désolé de pas avoir pu te fournir plus d'aide mais en espérant que ça t'aide un minimum

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 10 ans 11 mois #20271 par Doni
Réponse de Doni sur le sujet Re:cmd en powershell
Émeric pour ta réponse le début m'aide déca beaucoup.

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.033 secondes
Propulsé par Kunena