Power Shell Flashcards

1
Q

En power shell, borra el valor de una propiedad (T)

A

Clear-ItemProperty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

En power shell, borra el valor de una variable (T)

A

Clear-Variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

En power shell, compara dos conjuntos de objetos

A

Compare-Object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

En power shell, convierte objetos a CSV

A

ConvertTo-CSV

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

En power shell, convierte objetos a HTML

A

ConvertTo-Html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

En power shell, convierte objetos a XML

A

ConvertTo-XML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

En power shell, copia un objeto de un lugar a otro

A

Copy-Item

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

En power shell, depura un proceso (T)

A

Debug-Process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

En power shell, desactiva la restauración del sistema en una unidad (T)

A

Disable-ComputerRestore

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

En power shell, activa la restauración del sistema en una unidad

A

Enable-ComputerRestore

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

En power shell, consulta de usuarios del AD

A

Get-ADUser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

En power shell, muestra la lista de paquetes .appx instalados (T)

A

Get-AppxPackage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

En power shell, muestra un listado de comandos instalados de todo tipo (cmdlet, alias, function, applitcation, filter,etc)

A

Get-Command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

En power shell, muestra los puntos de restauración (T)

A

Get-ComputerRestorePoint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

En power shell, muestra el contenido de un objeto

A

Get-Content

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

En power shell, muestra la fecha y hora

A

Get-Date

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

En power shell, muestra la cola de eventos (T)

A

Get-Event

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

En power shell, muestra ayuda sobre comandos

A

Get-Help

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

En power shell, muestra el histórico de comandos usados en la sesión

A

Get-History

19
Q

En power shell, selecciona procesos ejecutándose en el sistema

A

Get-Process

20
Q

En power shell, selecciona los servicios del sistema

A

Get-Service

21
Q

En power shell, Establecer una Zona Horaria comando similar: tzutil /s

A

Set-TimeZone

22
Q

En power shell, Muestra el contenido de un directorio (T)

A

Get-ChildItem

23
Q

En power shell, Nos sirve para filtrar la salida de otro cmdlet

A

Where-Object

24
Q

En power shell, recorre una serie de objetos y ejecuta el script que tenga entre {} (T)

A

ForEach-Object

25
Q

En power shell, Obtener informacion de configuracion a traves de WMI

A

Get-CimInstance

26
Q

En power shell, Muestra el directorio actual

A

Get-Location

27
Q

En power shell, navegar por el registro, certificados etc

A

Get-PSDrive

28
Q

Get-Help Start-Service -Full

A

Ayuda completa del Start-Process. Como man de Linux

29
Q

Get-TimeZone -ListAvailable

A

lista las zonas horarias disponible

30
Q

Get-ChildItem | Get-Member -MemberType Properties

A

FileInfo y DirectoryInfo

31
Q

Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion

A

consulta esa clave del registro

32
Q

Get-ChildItem -Filter “obs” -Recurse -File

A

Como un find de Linux

33
Q

Copy-Item -Path ‘.\Tools' -Destination $env:USERPROFILE -Recurse

A

Linux a: cp -R Tools ~/ )

34
Q

New-Item -ItemType Directory -Name ‘MyNewFolder’

A

crea una nueva carpeta

35
Q

Get-Content -Tail 7 .\obs.txt

A

Tail de Linux

36
Q

Select-String -Path ‘C:\error.log’ -Pattern ‘Failed’

A

grep de Linux

37
Q

Invoke-Command -ComputerName Servidor1 {Stop-Process Powershell}

A

enviar el comando para que se pare el proceso de Powershell al Servidor1

38
Q

Get-Process | Where-Object { $_.WorkingSet -gt $TamañoMemoria }

A

Obtiene los procesos que ocupan en memoria mas de $TamañoMemoria

39
Q

Get-CimInstance -ClassName Win32_Processor

A

informacion de la CPU

40
Q

$notepad = Get-Process notepad

A

El comando $notepad = Get-Process notepad en PowerShell se utiliza para obtener información sobre el proceso de Notepad que se está ejecutando en tu sistema.

Aquí está lo que hace:

Get-Process notepad: Este comando obtiene el proceso de Notepad.
$notepad: Asigna el resultado del comando anterior a la variable $notepad.
Esto te permite almacenar información sobre el proceso de Notepad en la variable $notepad para que puedas usarla más adelante en tu script o sesión de PowerShell.

41
Q

$notepad.Kill()

A

El comando $notepad.Kill() en PowerShell se utiliza para terminar el proceso de Notepad que has almacenado en la variable $notepad.

Aquí está lo que hace:

$notepad: Esta variable contiene información sobre el proceso de Notepad que obtuviste previamente con Get-Process notepad.
Kill(): Este método termina el proceso de Notepad de manera inmediata.
Es importante tener cuidado al usar este comando, ya que cerrará Notepad sin guardar ningún cambio no guardado en los archivos abiertos.

42
Q

Get-CimInstance -ClassName Win32_Processor

A

informacion de la CPU

43
Q

Test-Connec0.10.10.1 | Format-Table -AutoSize

44
Q

Invoke-RestMethod https://jsonplaceholder.typicode.com/posts -Method Post - Body @{title=”test post”;user=2}

A

Peticion REST pasando dos parametros por POST al estilo del comando curl en Linux