folks.
I'm creating a script for personal use and nothing to do about servers or users. It's about multimedia files, etc. The thing is, I'm trying to log everything that happens after I click in a button (I made a GUI).
So that's what I have so far:
$boton_procesar.Add_Click({
$pelicula_destino = $caja_seleccionar_pelicula_destino.Text
$ruta_pelicula_destino = Foreach-Object {
$pelicula_destino -replace '.mkv$', '.log'
$pelicula_destino -replace '.mp4$', '.log'
}
[string]$ruta_pelicula_destino = $ruta_pelicula_destino
Start-Transcript -LiteralPath $ruta_pelicula_destino
##some code over there (not finished because here will be the final code, I want to log everything)
Stop-Transcript
I'm not getting any error message, so I don't know what happens. It looks like everything is ok, but when I go to the folder where the .log should be, it's not.
Any guess?
$ruta_pelicula_destino
, I would recommend you to try to open the file form PS directly, for example add the linecode $ruta_pelicula_destino
at the end of the script (if you have VSCode)$resultado_seleccionar_pelicula_destino = $seleccionar_pelicula_destino.ShowDialog() if ($resultado_seleccionar_pelicula_destino -eq [System.Windows.Forms.DialogResult]::OK){ $caja_seleccionar_pelicula_destino.Text = $seleccionar_pelicula_destino.FileName $caja_seleccionar_pelicula_destino.SelectionStart = $caja_seleccionar_pelicula_destino.Text.Length $caja_seleccionar_pelicula_destino.SelectionLength = 0