Get-DellTags: Get Dell Tags and Express Service Code remotely

Function

ConvertSerial

{

<#

.

SYNOPSIS

Converts DELL Tag Serial into a DELL Express Service Code.

.

DESCRIPTION

Converts DELL Tag Serial into a DELL Express Service Code.

.PARAMETER Serial

Commit serial string.

.

LINK

Home

.

NOTES

Author: Sebastian Gräf

Email: [email protected]

Date: September 9, 2017

PSVer: 2.0/3.0/4.0/5.0

#>

param

(

$Serial

)

$36Base

=

"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"

$SerialLength

=

$Serial

.

length

$Script:DellServiceCode

=

0

for

(

$x

=

0

;

$x

-lt

$SerialLength

;

$x

++)

{

for

(

$y

=

0

;

$y

-lt

36

;

$y

++)

{

if

(

$Serial

.

substring

(

$x

,

1

)

-eq

$36Base

.

substring

(

$y

,

1

))

{

$answer

=

((

$y

)

*

([

math

]::

pow

(

36

,

$SerialLength

-

$x

-

1

)))

$Script:DellServiceCode

+=

$answer

}

}

}

}