Herramientas de usuario

Herramientas del sitio


informatica:soporte_instalacion:sistemas_operativos:windows:powershell

PowerShell

SSH

ssh <usuario>@<host> -p <NroPuerto>

Desorden

Para activar Powershell en pc remota

Enable-PSRemoting

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/enable-psremoting?view=powershell-7.2

# Ver servicios:

get-service

# guadar en una variable las credenciales:

$cred = get-Credential -credential admin@dom

#usar credencial y consultar servicios en otra máquina:

Get-WMIObject Win32_Service -computer MAQUINAREMOTA -credential $cred

# esto me dio error, pero si lo guardo en una variable funciona:

$service = Get-Service -ComputerName MAQUINAREMOTA
$service

# Reiniciar PC, no funciono:

Restart-Computer -ComputerName MAQUINAREMOTA

# Cargar a variable unos servicios

$service = Get-Service -ComputerName MAQUINAREMOTA -Name "*VNC*"
$service #para mostarlo en pantalla

#Ahora de ese VNC quiero ver sus metodos:

$service | Get-Member -Type Method

# me mostrará lo metoods que tinee ese servicio, iniciar, stop, ojo iniciar VNC requiere unos parametros.

$service.Stop() #Ojo cuidado que apaga el servicio pero para iniciarlo es dificil por los parametros

Comandos para reiniciar PC:

por CMD, el s lo apaga el /r lo reinicia (el shutdown -a aborta el reinicio o apagado)

shutdown /r /m \\[MI PC REMOTO] /t 60 /c “Por favor, finalice sus tareas”

Con PowerShell:

Restart-Computer –ComputerName “NAME_OF_SYSTEM”

Conexion remota:

Ejecución scripts

En el terminal de Visual Studio Code a veces ocurre que no puede ejecutar scripts

npm : No se puede cargar el archivo C:\Program Files\nodejs\npm.ps1 porque la ejecución de scripts está deshabilitada en este sistema. Para obtener más información, consulta 
el tema about_Execution_Policies en https:/go.microsoft.com/fwlink/?LinkID=135170.
En línea: 1 Carácter: 1
+ npm install -g typescript
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
informatica/soporte_instalacion/sistemas_operativos/windows/powershell.txt · Última modificación: 2026/06/06 07:11 por admin