> For the complete documentation index, see [llms.txt](https://cookiez.gitbook.io/red-team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cookiez.gitbook.io/red-team/cloud/azure/general.md).

# General

**Save Credentials**

```
$creds = get-credential

$password = ConvertTo-SecureString '<PASSWORD>' -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential('<USERNAME>', $password)
```

**Find a specific file**

```
Get-Childitem -Path C:\ -Force -Include <FILENAME OR WORD TO SEARCH> -Recurse -ErrorAction SilentlyContinue
```

**Rename powershell windows**

```
$host.ui.RawUI.WindowTitle = "<NAME>"
```

**Save pssession in variable**

```
$sess = New-PSSession -Credential $creds -ComputerName <IP>
```

**Run commands on machine**

```
Invoke-Commannd -ScriptBlock {COMMAND} -Session $sess
```

**Load script on machine**

```
Invoke-Commannd -Filepath <PATH TO SCRIPT> -Session $sess
```

**Copy item through PSSession**

```
Copy-Item -ToSession $sess -Path <PATH> -Destination <DEST> -verbose
```

**Microsoft Portals**

```
https://msportals.io/?search=
```
