mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Generates random data
This commit is contained in:
41
Examples/GenerateData/GenDataForCustomReport.ps1
Normal file
41
Examples/GenerateData/GenDataForCustomReport.ps1
Normal file
@@ -0,0 +1,41 @@
|
||||
if(!(gcm ig1 -ErrorAction SilentlyContinue)) {
|
||||
|
||||
"Use ``Install-Module NameIT`` to get the needed module from the gallery to support running this script"
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
$sign=@{sign=echo + -}
|
||||
$location=@{location=echo Atlanta Newark Washington Chicago Philadelphia Houston Phoneix}
|
||||
|
||||
$(1..6 | % {
|
||||
|
||||
$from=$to=""
|
||||
while($from -eq $to) {
|
||||
$from=ig "[location]" -CustomData $location
|
||||
$to=ig "[location]" -CustomData $location
|
||||
}
|
||||
|
||||
[double]$a=ig "########"
|
||||
[double]$b=ig ".####"
|
||||
[double]$c=ig "#######"
|
||||
[double]$d=ig "[sign].##" -CustomData $sign
|
||||
[double]$e=ig "###"
|
||||
[double]$f=ig "[sign]##" -CustomData $sign
|
||||
|
||||
#"{0},{1},{2},{3},{4},{5},{6},{7}" -f $from, $to, $a, $b, $c, $d, $e, $f
|
||||
|
||||
[PSCustomObject][Ordered]@{
|
||||
From=$from
|
||||
To=$to
|
||||
RDollars=$a
|
||||
RPercent=$b
|
||||
MDollars=$c
|
||||
MPercent=$d
|
||||
Revenue=$e
|
||||
Margin=$f
|
||||
}
|
||||
} | ConvertTo-Csv -NoTypeInformation) -replace '"',''
|
||||
|
||||
#| Export-Excel
|
||||
# | ConvertTo-Csv -NoTypeInformation) -replace '"','' | ConvertFrom-Csv | Export-Excel
|
||||
Reference in New Issue
Block a user