-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneral.ps1
More file actions
43 lines (37 loc) · 1013 Bytes
/
General.ps1
File metadata and controls
43 lines (37 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<#
.SYNOPSIS
Examples of how to use the Lua module.
#>
# Import the module
Import-Module -Name 'Lua'
# Convert a PowerShell hashtable to Lua table notation
$config = [ordered]@{
name = 'ElvUI'
version = '13.74'
enabled = $true
scaling = 0.85
authors = @('Elv', 'Simpy', 'Blazeflack')
}
$luaOutput = $config | ConvertTo-Lua
Write-Output $luaOutput
# Convert a Lua table string to a PowerShell object
$luaString = @'
{
name = "ElvUI",
version = "13.74",
enabled = true,
unitframes = {
playerWidth = 270,
playerHeight = 54
}
}
'@
$result = $luaString | ConvertFrom-Lua
Write-Output "Name: $($result.name)"
Write-Output "Player Width: $($result.unitframes.playerWidth)"
# Convert Lua to PSCustomObject
$obj = '{ server = "localhost", port = 8080 }' | ConvertFrom-Lua
Write-Output "Server: $($obj.server), Port: $($obj.port)"
# Compressed output
$compressed = @(1, 2, 3, 4, 5) | ConvertTo-Lua -Compress
Write-Output "Compressed: $compressed"