Get-stat for monthly trends of data warehouses

Hi all

Long time lurker of time,

I have not been using PS for long and mostly just pin out one liners for things like "whats connected to X", etc.

I'm trying to output a file that I can put in excel and create configured vs used graphics is the idea.

I would like to get this down so I can manipulate to other entities.

I can wrap this around a foreach loop that I can usually understand.

With get-stat, I noticed that he gets a single value, then the other so the MetricID is evolving, so I can't just select the property.

I have a script already where I show the last value and then put them all on the same graph, but it would be cool to have a chart with the data store to see the trends.

We have vcops, but I find the graphics a slow process, because we have dozens of warehouses of data around the world.

It's my script simple I must then cut and paste the values into additional columns, but who wants to do it manually

I can do something like this

$todayMidnight = (get-Date-time Minute 0 - 0 - 0 second)

$Startmonth = - 1

$metrics = "disk.capacity.latest", "disk.provisioned.latest", "disk.used.latest".

$datastore = "vm_production01".

$arrds = get-datastore. WHERE-object {$_.} Name - like $datastore}

$a = get - Stat - $arrds - Stat $metrics entity [0] - boot $todayMidnight.AddMonths ($Startmonth) - complete $todayMidnight | where {$_.instance - eq ""} | Sort the timestamp | Select the timestamp value

$b = get - Stat - $arrds - Stat $metrics entity [1] - boot $todayMidnight.AddMonths ($Startmonth) - complete $todayMidnight | where {$_.instance - eq ""} | Sort the timestamp | Select the value

$c = get - Stat - $arrds - Stat $metrics entity [2] - boot $todayMidnight.AddMonths ($Startmonth) - complete $todayMidnight | where {$_.instance - eq ""} | Sort the timestamp | Select the value

$fin = $a + $b + $c

$fin = $a + $b + $c

$fin | ConvertTo-Csv | Out-file C:\support\scripts\development\datastoreusage.csv

See the attachment for the final goal.

I don't know if I need to create a custom object to accomplish, if someone could help me that would be great.

and none of the useful articles where I can learn to do it, I'm almost finished powershell in a month of meals but I do not think that this is covered

Thank you all

To run this for all your storage data and then create a spreadsheet with the data store, you can use the function of export-Xlsx .

The script should look like this

$todayMidnight = (get-Date-time Minute 0 - 0 - 0 second)

$Startmonth = - 1

$metrics = "disk.capacity.latest", "disk.provisioned.latest", "disk.used.latest".

$ds = get-Datastore

$xlsxPath = "C:\ds-report.xlsx".

Get-Stat - $ds - Stat $metrics entity - boot $todayMidnight.AddMonths ($Startmonth) - complete $todayMidnight |

Group-object - property {$_.} @entity.name} | %{

$dsStats = $_. Group | Group-object - property Timestamp | %{

New-object PSObject-property @ {}

Timestamp = $_. Name

'Capacity (GB)' = [Math]: Round (($_.)) Group |

where {$_.} MetricId - eq "disk.capacity.latest" - and $_. ({Instance - eq ' '}). Value / 1 MB, 2)

'Allocated (GB)' = [Math]: Round (($_.)) Group |

where {$_.} MetricId - eq "disk.provisioned.latest" - and $_. ({Instance - eq ' '}). Value / 1 MB, 2)

'Used (GB)' = [Math]: Round (($_.)) Group |

where {$_.} MetricId - eq "disk.used.latest" - and $_. ({Instance - eq ' '}). Value / 1 MB, 2)

}

}

$dsStats | Tri-objet-Timestamp property |

Select the Timestamp, 'Ability (GB)', 'allocated (GB) ', ' used (GB) |

Export-Xlsx-path $xlsxPath - AppendWorksheet - WorksheetName $_. Name of the end - SheetPosition

}

Tags: VMware

Similar Questions

  • Get errors for the user input data filter no KB 911895 HID

    OT: iI have windows xp S/P 3 installed also apple i pad I get errors for the user input data filter no KB 911895 HID
    What should I do to get rid of this popup that wizzard windows keeps giving me?

    Hi Graybeard,

    What is the exact error message you get?

    HID Non-User Input data filter is an optional update. I suggest you try the steps from the following link:

    The screen saver does not start after the installation of a wireless pointing device
    http://support.Microsoft.com/kb/913405

    What version of the operating system Windows am I running?
    http://Windows.Microsoft.com/en-us/Windows7/help/which-version-of-the-Windows-operating-system-am-i-running

    Troubleshooting Windows Update or Microsoft Update when you are repeatedly offered an update
    http://support.Microsoft.com/kb/910339

  • Script Get-stat for VM Perfomance - Questions

    I am writing a script to get data on our virtual machine performance of the measures of depth for CPU and memory.  Its a great project task I have to do for our mgt and so I am writing a script extremely important and vital for our company.  I use the command get-stats and feedback from the messages I posted about get-stat in particular lucd and lebouf who have been very helpful.  But I have collected their answers and writes the script below.  Currently, it must be used with an argument, but I can change it later.  It also uses many counters of cpu and memory that is why it is a long script.  But I have a lot of questions on the script before I run it, I need to be clear with the data I receive in return.  The script is below:

    $vm = $args

    $vmguest = @{N = 'operating System'; {E = {.osfullname (get-vmguest - VM $_)}}

    Get - VM $args | where {$_.} PowerState - eq "Receptor"} | `

    Select name, NumCpu MemoryMB,

    @{N = "Mem.Usage.Average"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.usage.average | Measure-object-propriete value - average). Average}},

    @{N = "Percentage of use memory Maxiumn"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.usage.maximum | Measure-object-propriete value - average). Average}},

    @{N = "Memory use Ko"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.consumed.average | Measure-object-propriete value - average). Average}},

    @{N = "Memory status"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.state.latest | Measure-object-propriete value - average). Average}},

    @{N = "Memory Swapin average ko"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.swapin.average | Measure-object-propriete value - average). Average}},

    @{N = "Memory Swapout average ko"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.swapout.average | Measure-object-propriete value - average). Average}},

    @{N = 'Memory reserved MB capacity'; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.reservedCapacity.average | Measure-object-propriete value - average). Average}},

    @{N = 'Average CPU usage percentage'; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.usage.average | Measure-object-propriete value - average). Average}},

    @{N = "CPU REady"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.ready.summation | Measure-object-propriete value - average). Average}},

    @{N = "Maximum percentage of CPU usage"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.usage.maximum | Measure-object-propriete value - average). Average}},

    @{N = "Use CPU MHZ on average"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.usagemhz.average | Measure-object-propriete value - average). Average}},

    @{N = "Maximum MHZ CPU utilization"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.usagemhz.maximum | Measure-object-propriete value - average). Average}},

    @{N = "MHZ CPU reserved"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.reservedCapacity.average | Measure-object-propriete value - average). Average}} | `

    Export-Csv c:\stats5.csv

    The questions I have are:

    The first question is I want the stats to be based on the last 7 days, so I used the .adddays (-7).  It would give me the last 7 days stats?

    In my settings of virtual center statistics, I have all interval times checked.  So if I want last 7 days stats, I would use the samples for the interval of 30 minutes duration.  Also I have not used all interval parameter in the get-stat, so my samples will be based on the interval of 30 minutes.  Is this correct?

    Also, I have not used the maxsample interval, so by default I get to use all the values in the sample, and measures will give me the average of all samples (duration 30 min) values in the last 7 days.  Is that correct. ?

    Another key question is that is it possible to get readings of samples for only Monday to Friday, from 06:00-18:00, as this is when the virtual machine is used.  I don't know how this can be done and how it can be incorporated in the above script.  Is this possible to do?

    Also about the measure-object cmdlet, I used to all counters, as for the average values of use of cpu and memory.  I also use counters for cpu and memory max.  Would I need to use the average value of the object of measures to this end, as this counter will give me the max value for cpu/memory for all 7 days, which will be a single value, because I want to know the max value, it achieved, so I don't know if I have to use measure-object with these counters, do I need to use?

    About the ready CPU meter I use, also gives the value in millseconds.  Is it possible to get loan from cpu percentage value as we see in ESXTop because it is easier to understand for the cpuready.  I don't see any counter loan as a percentage of the CPU.  Is it possible to get a value for it.

    With the - equal Start parameter to specify that you want the values from 1 day back.

    This means that you will get the values historical interval 1 and the period interval 5 minutes ago.

    It is the HI1 interval in the scheme of part 1.

    When you specify not one - Start parameter and - finishing you will in effect of the values of historical interval 4, which has a period of 1-day interval.

    In a next blog post, I will talk about default values in the cmdlet Get-Stat.

  • Get-Stat for use of the power of the ESXi Server

    Hi all

    Need your help to get a script to capture power consumption/use of an esxi host. I checked the command get-stat, I don't see any special argument as energy consumption in check for the host entity. The time interval can be anything, I'd like to see the same values that manifest slot for power under the tables of performance of an esxi host.

    Any help would be appreciated.

    Thanks in advance

    Try like this

    10 P
    002
    003
    004
    005

    $entity = get-VMHost-name MyEsx
    $stat = "power.power.average".

    Get-stats - $entity - $stat - Realtime - MaxSamples 1 Stat entity

  • Using the cmdlet Get-stats for the problems of performance of ESXi

    I need to detect the bottlenecks (if any) causing poor performance with a (free) 5.5 ESXi host.

    I see that if I use the cmdlet Get - stat PowerCLI I get dozens of meters, such as "mem.usage.average" or "'rescpu.maxlimited1.latest ', just to give two samples. "

    Can I identify a subset of the counters I should follow to identify possible bottlenecks in the fastest way possible?

    Concerning

    Marius

    Everything depends of course.

    There are several positions which list a number of key counters to watch.

    The Hosts of ESXi monitoring - a deeper on the what and the why look , you will find a good starting set.

  • Get-stat - disk for virtual machines on NFS data warehouses

    Hi all

    Through work for VMs on NFS data warehouses get-stat-disc?

    $myVM | Get-stat - disc

    Doesn't seem to work for VMs on NFS data warehouses, but that works for VMs on VMFS data warehouses.

    After a presentation of VMware to http://webcache.googleusercontent.com/search?q=cache:h78Db7LqHcwJ:www.slideshare.net/vmwarecarter/powercli-workshop+%2Bget-stat+%2Bnfs & cd = 2 & hl = in & ct = Europeans & gl = at the & source = www.google.com.au

    «WARNING: NFS performance statistics are not available (to come in a future version of vSphere).»

    When these statistics are available for NFS data storage?

    Kind regards

    marc0

    The answer is in the property of instance data that Get-Stat returns.

    (1) get-Stat ==> canonical name of the LUN on which disk the hard

    (2) get-Stat virtualdisk ==> The SCSI id of the virtual disk inside the VM

    (3) get-Stat data store ==> the name of the data store

    (1) you give statistics for view virtual machine i/o activity starting from the LUN. For a VM with several virtual disks on the same data store, this will display the total IO statistics. And it will also include i/o generated by another VM on the LUN as swap, Flash files related...

    (2) gives statistics for 1 specific virtual disk of your virtual machine

    (3) statistics of e/s of your VM to a specific data store. Interesting when you have a store of data with multiple extensions (multiple LUNS)

    I hope that clarifies it a bit.

  • Oracle Business Intelligence Data Warehouse Administration Console 11 g and Informatica PowerCenter and Guide of Installation PowerConnect adapters 9.6.1 for Linux x 86 (64-bit)

    Hi all

    I'm looking for full installation GUIDE for Oracle Business Intelligence Data Warehouse Console Administration 11 g and Informatica PowerCenter and PowerConnect 9.6.1 for Linux x 86 (64 bit) adapters. I just wonder is there any url that you can recommend for installation. Please advise.

    Looks like these are ask you.

    http://docs.Oracle.com/CD/E25054_01/fusionapps.1111/e16814/postinstsetup.htm

    http://ashrutp.blogspot.com.by/2014/01/Informatica-PowerCenter-and.html

    Informatica PowerCenter 9 Installation and Configuration Guide complete | Training of Informatica & tutorials

  • get all the date of end of months between two dates

    Hi all, I'll try to find together the date of end of months between two dates.
    I have the following data in a table

    WITH AS's Data1
    (
    SELECT To_Date('4/30/2009','mm/dd/yyyy') dt, 'TEST' lname FROM dual UNION ALL
    SELECT To_Date('5/01/2009','mm/dd/yyyy') dt, "TEST2" lname FROM dual UNION all
    SELECT To_Date('5/02/2009','mm/dd/yyyy') dt, "TEST3" lname FROM dual UNION all
    SELECT To_Date('5/03/2009','mm/dd/yyyy') dt, "TEST4" lname FROM dual UNION all
    SELECT To_Date('5/04/2009','mm/dd/yyyy') dt, "TEST5" lname FROM dual UNION all
    SELECT To_Date('5/05/2009','mm/dd/yyyy') dt, "TEST6" lname FROM dual UNION ALL
    SELECT To_Date('5/31/2009','mm/dd/yyyy') dt, 'TEST7' lname FROM dual UNION all
    SELECT To_Date('6/01/2009','mm/dd/yyyy') dt, 'TEST' lname FROM dual

    )

    I would like to write an application that gives you all the end date for months between two dates
    for example, if you give the date 9/1/4 and 5/6/9, the output should be
    DT          LNAME
    -------------------
    4/30/2009   TEST
    IF I give you the dates 01/04/09 AND 01/06/09, THEN output should be
    DT          LNAME
    -------------------
    4/30/2009   TEST
    5/31/2009   TEST7
    as you can see, I want all the end dates of months between two dates by giving the output.

    If I give you 06/05/09 and 05/06/09, and then does so no output because there is no end of month between these two dates.
    Similarly, if I give you 30/04/09 and 30/04/09 then output should be 30/04/09 because it is an end of month date

    anyone can help to write a query. Thank you very much

    Jin
    Not sure if you need subquery, analytical functions for this.
    According to me, which should solve your purpose.

    WITH data1 AS
    (
    SELECT To_Date('4/30/2009','mm/dd/yyyy') dt, 'TEST' lname FROM dual UNION ALL
    SELECT To_Date('5/01/2009','mm/dd/yyyy') dt, 'TEST2' lname FROM dual UNION all
    SELECT To_Date('5/02/2009','mm/dd/yyyy') dt, 'TEST3' lname FROM dual UNION all
    SELECT To_Date('5/03/2009','mm/dd/yyyy') dt, 'TEST4' lname FROM dual UNION all
    SELECT To_Date('5/04/2009','mm/dd/yyyy') dt, 'TEST5' lname FROM dual UNION all
    SELECT To_Date('5/05/2009','mm/dd/yyyy') dt, 'TEST6' lname FROM dual UNION ALL
    SELECT To_Date('5/31/2009','mm/dd/yyyy') dt, 'TEST7' lname FROM dual UNION all
    SELECT To_Date('6/01/2009','mm/dd/yyyy') dt, 'TEST' lname FROM dual 
    
    )
    select distinct last_day(dt) dt,lname
      from data1
     where dt between &start_date and &end_date
       and last_day(dt) <= &end_date
    
    also, i have another request. how would i do this without using the data i provided. lets say,
     i tell you, give me alll the months end between two dates using dual in the from clause of a query.
    how would you do this in a query or pl/sql? thanks again
    

    Can be like that

    with data1 as(
    select &start_date+level-1 dt from dual
    connect by level <= &end_date-&start_date+1)
    select distinct last_day(dt)
      from data1
     where dt between &start_date and &end_date
       and last_day(dt) <= &end_date
     order by last_day(dt)
    

    See you soon!
    Bobin

    Published by: Buga added query for updated the need

  • Cluster data warehouses

    I would like to create a dashboard that displays a list of all VMWare clusters and for each handset display data warehouses that are used for each of them. Looking for a way to create the dashboard without slipping each store data in the dashboard.

    1 is it possible with a query of the user interface?

    Data > VMWare > centers > (name datacenter) > cluster > (cluster name) > ESX host > (host name) > storage > data warehouses

    If you want the names and what may not be a little cleaner that I would try this, it also removes the need for the additional query keep things all neat.

    cluster = server.get ("QueryService").queryTopologyObjects("!) VMWCluster')

    output =]

    (cluster in clusters)

    {

    data warehouses = cluster.esxServers.datastores

    for (data in data warehouses store)

    {

    map = [VMWCluster:cluster.name, VMWDatastore: datastore.name]

    output. Add (Map)

    }

    }

    return output

  • Average read get-stat - virtualdisk.read.average stat?

    Hi all

    I want to use the metric virtualdisk.read.average to calculate the average read speeds per virtual disk to a virtual computer in the last 24 hours (using the 5 min interval)

    [1]

    I want to calculate the average in * every * instance and then add these individual averages until you get the desired amount.

    For example (using real-time output just for example only, I want 24 hours actually):

    MetricId unit Insta timestamp value
    NCE
    --------                ---------                          ----- ----     -----
    VirtualDisk.Read.Ave... 13/05/2011 19:39 6 Kbps scsi0:0
    VirtualDisk.Read.Ave... 13/05/2011 19:38:40 Kbps 11 scsi0:0
    VirtualDisk.Read.Ave... 13/05/2011 19:38:20 KBps 39 scsi0:0
    VirtualDisk.Read.Ave... 13/05/2011 19:38 431 Kbps scsi0:0
    VirtualDisk.Read.Ave... 13/05/2011 19:39 10 Kbps scsi0:1
    VirtualDisk.Read.Ave... 13/05/2011 19:38:40 Kbps 0 scsi0:1
    VirtualDisk.Read.Ave... 13/05/2011 19:38:20 5 kbps scsi0:1
    VirtualDisk.Read.Ave... 13/05/2011 19:38 0 Kbps scsi0:1

    Average (6 + 11 + 39 + 431) = 121.75

    average (10 + 0 + 5 + 0) = 3.75

    Total liked: 121.75 + 3.75 = 125,5

    What is the best way to achieve this? (Unfortunately there is no global instance as with the network and cpu.usagemhz parameters)

    [2]

    For the calculation of the IOPS / s, if you use the metric datastore.*, OR as the virtualdisk.*, is the following statement, 100% good:

    (a) virtualDisk.number [Read |] Write] Averaged.Average will calculate the OPS are / s generated by the virtual machine

    (b) disk.number [Read |] Write] .summation will calculate the OPS are / s that hit this particular data store (useful to see how busy is a data store - but will not provide any info on a single virtual machine (unless by chance, there is only a virtual computer on this data store special))

    [3]

    How to use virtualDisk.number [Read |] Write] calculate the IOPS / s for a given virtual machine?  Depending on the issue [1], to each VMDK, PAHO are / s on average individually and then add the averages for overall IOPS generated by this virtual machine in the last 24 hours?

    Concerning

    marc0

    Kind regards

    marc0

    [1] use the Group-Object and Measure-Object cmdlets for this.

    For example

    $vm = Get-VM MyVM $report = @()
    $stats = Get-Stat -Entity $vm -Stat virtualdisk.read.average -Start (Get-Date).AddHours(-12)
    $stats | Group-Object -Property Instance | %{
        $row = "" | Select Instance,Average
        $row.Instance = $_.Group[0].Instance
        $row.Average = ($stats | Measure-Object -Property Value -Average).Average
        $report += $row}
    $report $total = ($report | Measure-Object -Property Average -Sum).Sum
    Write-Host $vm.Name $total
    

    This will calculate the averages per virtual disk and add the averages together

    [2] see my post get PAHO are / s maximum .

    (a) Yes, provided that you add the OPS are / s for each virtual disk total

    (b) No, if you run the Get-Stat for an entity that is a virtual machine, you will get the statistics for this specific VM disk.

    The metric is available for HostSystem and VirtualMachine. See the column of the entity in the drive settings page.

    [3] Yes

  • Average values for separate sets of data graph XY multiplot

    Hello

    I'm using Labview 2010 and I'm a bit of a novice, unfortunately.

    So I am currently trying to get average values of the three plots I have on a multiplot XY Chart. I thought the best way to achieve this would be to use the express VI of statistics, but when I try to wire the data I need for this I can get statistics for a set of data and not the other two.

    I don't know how the separately on data sets, as it is not a table.

    If anyone can help me, it would be much appreciated. Sorry for the probable simplicity of the question.

    (The program is basically an ODE Solver, which then displays pressure at different places in a bioreactor).

    In the small LOOP where you have data of y for each parcel in the form of a 1 d table, add a "mean.vi" in the math palette: statistics. AutoIndex the output on the edge of the loop to get a table 1 d containing three ways.

    (In addition, a lot of your code could be considerably simplfified. You can [i] connect directly to the structure of the case and a case of '0' and the other, by default. Better would simply initialize the shift, no means required register. Index table is resizable, so you don't need to a single instance on the lower right corner. Wouldn't be easier to just get the latest column and it wire back the entrance inside the structure cases via the feedback node? No need to "subset of table to replace").

    You have forgotten to attach a Subvi, so we can't really test.

    EDH is a quick project:

  • RMAN duplication and expiration of the directives on the environment of data warehouse

    Operating systems: Windows Server 2008
    DB: Oracle 11 g 2

    Are there guidelines how often one should do a RMAN duplication and assign an expiration on archivelogs for data warehouse environments?
    It me appears once a day would be enough for overlapping in a data warehouse environment which is updated nightly. Expiration, I don't expect less than 1 week.
    See you soon!

    I agree with damorgan

    See the links for the best practices below.

    http://www.Oracle.com/technetwork/database/features/availability/311394-132335.PDF
    https://blogs.Oracle.com/Datawarehousing/entry/data_warehouse_in_archivelog_m

    Hope this helps,

    Concerning
    http://www.oracleracepxert.com
    Understand the power of the Oracle RMAN
    http://www.oracleracexpert.com/2011/10/understand-power-of-Oracle-RMAN.html
    Duplication of data base RAC with RMAN
    http://www.oracleracexpert.com/2009/12/duplicate-RAC-database-using-RMAN.html

  • get guests basic stats and data warehouses

    Hi all

    I am totally new to vcenter and power shell, so please, be gentle on my stupid questions. I'm desperate to compile a script to get the weekly statistics for host, County of vcpu and data store memory space and export it to a csv file. Numbers so very basic for each host computer and the data store. Here's what I have so far based on blogs of the LucD generous. It would be great if someone of you can help me realize what is wrong...

    It took a lot of time for me to understand what are the parameters I need and I'm sure that they are correct, but the syntax is killing me now. Basically, I realize there is something wrong with my variables since nothing is exported to the file you want, but I do not know how to define variables and their attributes. And the error was "impossible to replace the host variable because it is read-only or constant", while other properties such as "name", "mem", etc.

    SE connect-VIServer-server xxx.com - user password xxx-xxxx

    $allhosts = @)

    $hosts = get-VMHost

    $allds = @)

    $datastores = get-DataStore

    {foreach ($vmHost in $hosts)

    $host = "" | Select 'name', 'mem', 'vcpu '.

    $$host.name = $vmHost.Name

    $host.mem = get-Stat-entity ($vmHost) - start (Get-Date). AddDays(-1)-Finish (Get-Date) - MaxSamples 1 - Stat "mem.consumed.average" |  Select - ExpandProperty value

    $host.vcpu = get-VM-location ($vmHost). Where-Object {$_.} PowerState - eq "Receptor"} | Measure-object-property NumCpu-sum |  Select - ExpandProperty sum

    $allhosts += $host

    }

    $allhosts | Export-csv - NoTypeInformation C:\host.csv

    foreach ($dataStore to $datastores |) Where-Object {$_ .name - like "xxxx *"}) {}

    $dsName = $dataStore.Name

    $provspace = get-Stat-entity ($dataStore) - start (Get-Date-time Minute 9 - 0-0 second) - Finish (Get-Date-time-Minute 10 - second 0-0) - IntervalSecs 30000 - Instance "-disk.provisioned.latest stat. Select - ExpandProperty value

    $freespace = $datastores | Select-Object Name, FreeSpaceGB

    }

    $allds | Select DataStorename, provspace, freespace | Export-csv - NoTypeInformation C:\datastore.csv

    Thank you in advance!

    -LX

    Unfortunately, you chose a PowerShell reserved name for the name of the variable.

    The $host variable is not allowed.

    Choose another name and the script should be ok

  • How to get LASTDAY for each month between data dates...

    Hi friend

    I have a doubt, how to get LASTDAY for each month between data dates...

    for ex:
    My contribution will be like this
    date = 01/12/2011
    To date = 14/04/2011

    And I need an output like
    31/01/2011
    28/02/2011
    31/03/2011

    is it possible to achieve through sql query in oracle
    Thanks in advance for all friends to help him

    Hello

    Something like this (assuming that the dates are originally VARCHAR2s):

    SQL> var dt_start varchar2(10)
    SQL> var dt_end varchar2(10)
    SQL> exec :dt_start := '12-01-2011'
    
    PL/SQL procedure successfully completed
    
    SQL> exec :dt_end := '14-04-2011'
    
    PL/SQL procedure successfully completed
    
    SQL>
    SQL> select last_day(
      2           add_months(
      3             trunc(to_date(:dt_start,'DD-MM-YYYY'),'MM'),
      4             level-1
      5           )
      6         ) as result
      7  from dual
      8  connect by level <= months_between(to_date(:dt_end,'DD-MM-YYYY'), to_date(:dt_start,'DD-MM-YYYY'))
      9  ;
    
    RESULT
    -----------
    31/01/2011
    28/02/2011
    31/03/2011
     
    

    If the dates are already of the date data type, simply remove the to_date function.

  • How can I get date uniform and exit time to get-stat on servers located in areas with different regional settings?

    Hello together,

    I use a HSP on different vCenters script all over the world to sample performance data. Unfortunetaly vCenter servers concerninbg time Windows locale and date are different. For this reason that I ve had different and output date at the time of the csv. Here is an example to read a virtual computer processor performance.

    Get-Stat - feature $vm.name - Stat "cpu.usage.average" - IntervalMins 5 - (Get-Date).adddays(-1)-.addminutes(-5)-MaxSamples Start to finish (Get-Date) 288. Select-Object timestamp, value, unit | Export-Csv

    vCenter Server located in the United States with the American Time (12-hour AM/PM) and the settings of Date (day/month/year):

    'Timestamp', 'Value', 'unit '.

    "2010-06-27 12:00 PM","2.75","%.

    "

    "

    vCenter Server located in Europe with countries European regionalen (24 hours) and Date settings (day.month.year):

    Timestamp, value, unit

    "21.06.2010 20:00:00", "3.06", %

    "

    "

    For the import of these data to our central database, the formats must be uniform.

    Someone at - it an idea to get the uniform format?

    Thanks in advance

    Concerning

    Oliver

    Why don't you use the solution in Use-Culture - Culture culture - Script {scriptblock} ?

    You do all the writing to your database in 1 selected (for example en-US culture).

    This way all your date and and digital formats have the same layout.

    ____________

    Blog: LucD notes

    Twitter: lucd22

Maybe you are looking for

  • Share Contacts between accounts iCloud

    My wife and I have been using the same account iCloud, but now we do not want to store pictures under this shared account. However, we continue to share the same e-mail, calendar and contact information. Is this possible?

  • Change to the subject: the configuration via the mac terminal settings

    Hello I administer more than 140 computers mac, with firefox installed. Unfortunately, it seems like a daily appearance when a user calls and says that firefox is updated, listen to which they can't because they are not administrator accounts.Now, I

  • Satellite Pro U400 - BIOS update gone bad

    Hi all! I've updated the BIOS on my laptop and something was wrong, just not now a computer screen. I went to see the Web for Chris Bios recover.Have over 20 versions, but so far without success. My biggest problem is: I can't save on floppy disk 2 M

  • Windows 7 (64 bit) - smartmenu does not

    Hello I have re-installed windows 7 after that hdd has stopped working. I did it to each update (update of windows assistant hp, etc.). But my smartmenu does not work properly. I would like to use keyboard shortcuts for volume control (it works but I

  • Router RV042 firmware Upgrade older and what is the Version 1, 2, 3

    We have a CISCO RV042.  We are about to begin a service IOPV with Joseph who declare: The RV042 is a wired router that requires no adjustment configuration for versions of firmware, that we tested.    NOTE: The Version 1 and 2 are compatible. Version