当前位置: 首页 > news >正文

怎么夸一个网站开发公司毕设做网站需要买域名么

怎么夸一个网站开发公司,毕设做网站需要买域名么,成都定制网站设,网站开发与运营方向本脚本只统计了一半文件的大小数量,其它部分系统文件无访问权限。需要在 TrustedInstaller 权限下运行才能访问。如何获取 TrustedInstaller 权限。 # 统计C盘各种扩展名文件大小总和及数量的PowerShell脚本 $extSizes {} $totalFiles 0 $stopwatch [System.D…

本脚本只统计了一半文件的大小数量,其它部分系统文件无访问权限。需要在 TrustedInstaller 权限下运行才能访问。如何获取 TrustedInstaller 权限。
 

# 统计C盘各种扩展名文件大小总和及数量的PowerShell脚本
$extSizes = @{}
$totalFiles = 0
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()# 扫描文件并统计
Get-ChildItem -Path 'C:\' -File -Recurse -ErrorAction SilentlyContinue | ForEach-Object {$totalFiles++# 每处理5000个文件显示进度if ($totalFiles % 5000 -eq 0) {$elapsed = $stopwatch.Elapsed.ToString("mm\:ss")Write-Progress -Activity "扫描文件 (已处理 $totalFiles 个)" `-Status "当前: $([System.IO.Path]::GetFileName($_.FullName))" `-PercentComplete (($totalFiles % 100000)/1000)}$ext = $_.Extension.ToLower()if (-not $ext) { $ext = '_no_extension_' }if (-not $extSizes.ContainsKey($ext)) {$extSizes[$ext] = @{TotalSize = 0LCount = 0}}$extSizes[$ext].TotalSize += $_.Length$extSizes[$ext].Count++
}# 转换大小格式的函数
function Format-FileSize {param([long]$size)switch ($size) {{ $_ -ge 1TB } { return [math]::Round($_ / 1TB, 1).ToString('0.#') + "T" }{ $_ -ge 1GB } { return [math]::Round($_ / 1GB, 1).ToString('0.#') + "G" }{ $_ -ge 1MB } { return [math]::Round($_ / 1MB, 1).ToString('0.#') + "M" }{ $_ -ge 1KB } { return [math]::Round($_ / 1KB, 1).ToString('0.#') + "K" }default { return "$_ B" }}
}# 格式化数量显示(添加千位分隔符)
function Format-Count {param([int]$count)return $count.ToString("N0")
}# 准备结果数据
$results = @()
foreach ($ext in $extSizes.Keys) {$results += [PSCustomObject]@{Extension = $extSize      = Format-FileSize -size $extSizes[$ext].TotalSizeCount     = Format-Count -count $extSizes[$ext].CountTotalBytes= $extSizes[$ext].TotalSize}
}# 计算总扫描时间
$scanTime = $stopwatch.Elapsed.ToString("hh\:mm\:ss")# 输出结果表格(按总大小降序)
$sortedResults = $results | Sort-Object TotalBytes -Descending# 显示统计摘要
Clear-Host
Write-Host "`n文件扩展名统计报告 (C:\)" -ForegroundColor Cyan
Write-Host "扫描文件总数: $($totalFiles.ToString('N0'))" -ForegroundColor Yellow
Write-Host "扫描耗时: $scanTime" -ForegroundColor Yellow
Write-Host "发现扩展名类型: $($extSizes.Count)`n" -ForegroundColor Yellow# 格式化表格输出
$sortedResults | Format-Table @(@{Label="扩展名"; Expression={$_.Extension}; Width=12; Alignment="Left"}@{Label="大小"; Expression={$_.Size}; Width=10; Alignment="Right"}@{Label="数量"; Expression={$_.Count}; Width=15; Alignment="Right"}
) -AutoSize# 保存结果到CSV(修复数字扩展名问题)
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$csvPath = Join-Path -Path $env:TEMP -ChildPath "FileSizeSummary_$timestamp.csv"# 创建CSV内容(修复数字扩展名问题)
$csvData = $sortedResults | ForEach-Object {# 在数字扩展名前添加单引号防止Excel转换$fixedExtension = if ($_.Extension -match '^\.\d+$') {"'" + $_.Extension} else {$_.Extension}[PSCustomObject]@{Extension = $fixedExtensionSize      = $_.SizeCount     = $_.Count}
}$csvData | Export-Csv -Path $csvPath -NoTypeInformation -Encoding UTF8
Write-Host "`n结果已保存到: $csvPath" -ForegroundColor Green# 额外提示Excel处理建议
Write-Host "`n注意: 数字扩展名(如 .1, .2)在CSV中已添加前缀单引号'" -ForegroundColor Magenta
Write-Host "在Excel中打开时请检查扩展名格式是否正确,若仍不正确请手动设置格式:" -ForegroundColor Magenta
Write-Host "1. 全选扩展名列" -ForegroundColor Yellow
Write-Host "2. 右键选择'设置单元格格式'" -ForegroundColor Yellow
Write-Host "3. 选择'文本'格式" -ForegroundColor YellowRead-Host "按 Enter 退出"

# 统计C盘各种扩展名文件大小总和及数量的PowerShell脚本
$extSizes = @{}
$totalFiles = 0
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()

# 扫描文件并统计
Get-ChildItem -Path 'C:\' -File -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
    $totalFiles++
    # 每处理5000个文件显示进度
    if ($totalFiles % 5000 -eq 0) {
        $elapsed = $stopwatch.Elapsed.ToString("mm\:ss")
        Write-Progress -Activity "扫描文件 (已处理 $totalFiles 个)" `
                       -Status "当前: $([System.IO.Path]::GetFileName($_.FullName))" `
                       -PercentComplete (($totalFiles % 100000)/1000)
    }
    
    $ext = $_.Extension.ToLower()
    if (-not $ext) { $ext = '_no_extension_' }
    
    if (-not $extSizes.ContainsKey($ext)) {
        $extSizes[$ext] = @{
            TotalSize = 0L
            Count = 0
        }
    }
    $extSizes[$ext].TotalSize += $_.Length
    $extSizes[$ext].Count++
}

# 转换大小格式的函数
function Format-FileSize {
    param([long]$size)
    switch ($size) {
        { $_ -ge 1TB } { return [math]::Round($_ / 1TB, 1).ToString('0.#') + "T" }
        { $_ -ge 1GB } { return [math]::Round($_ / 1GB, 1).ToString('0.#') + "G" }
        { $_ -ge 1MB } { return [math]::Round($_ / 1MB, 1).ToString('0.#') + "M" }
        { $_ -ge 1KB } { return [math]::Round($_ / 1KB, 1).ToString('0.#') + "K" }
        default { return "$_ B" }
    }
}

# 格式化数量显示(添加千位分隔符)
function Format-Count {
    param([int]$count)
    return $count.ToString("N0")
}

# 准备结果数据
$results = @()
foreach ($ext in $extSizes.Keys) {
    $results += [PSCustomObject]@{
        Extension = $ext
        Size      = Format-FileSize -size $extSizes[$ext].TotalSize
        Count     = Format-Count -count $extSizes[$ext].Count
        TotalBytes= $extSizes[$ext].TotalSize
    }
}

# 计算总扫描时间
$scanTime = $stopwatch.Elapsed.ToString("hh\:mm\:ss")

# 输出结果表格(按总大小降序)
$sortedResults = $results | Sort-Object TotalBytes -Descending

# 显示统计摘要
Clear-Host
Write-Host "`n文件扩展名统计报告 (C:\)" -ForegroundColor Cyan
Write-Host "扫描文件总数: $($totalFiles.ToString('N0'))" -ForegroundColor Yellow
Write-Host "扫描耗时: $scanTime" -ForegroundColor Yellow
Write-Host "发现扩展名类型: $($extSizes.Count)`n" -ForegroundColor Yellow

# 格式化表格输出
$sortedResults | Format-Table @(
    @{Label="扩展名"; Expression={$_.Extension}; Width=12; Alignment="Left"}
    @{Label="大小"; Expression={$_.Size}; Width=10; Alignment="Right"}
    @{Label="数量"; Expression={$_.Count}; Width=15; Alignment="Right"}
) -AutoSize

# 保存结果到CSV(修复数字扩展名问题)
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$csvPath = Join-Path -Path $env:TEMP -ChildPath "FileSizeSummary_$timestamp.csv"

# 创建CSV内容(修复数字扩展名问题)
$csvData = $sortedResults | ForEach-Object {
    # 在数字扩展名前添加单引号防止Excel转换
    $fixedExtension = if ($_.Extension -match '^\.\d+$') {
        "'" + $_.Extension
    } else {
        $_.Extension
    }
    
    [PSCustomObject]@{
        Extension = $fixedExtension
        Size      = $_.Size
        Count     = $_.Count
    }
}

$csvData | Export-Csv -Path $csvPath -NoTypeInformation -Encoding UTF8
Write-Host "`n结果已保存到: $csvPath" -ForegroundColor Green

# 额外提示Excel处理建议
Write-Host "`n注意: 数字扩展名(如 .1, .2)在CSV中已添加前缀单引号'" -ForegroundColor Magenta
Write-Host "在Excel中打开时请检查扩展名格式是否正确,若仍不正确请手动设置格式:" -ForegroundColor Magenta
Write-Host "1. 全选扩展名列" -ForegroundColor Yellow
Write-Host "2. 右键选择'设置单元格格式'" -ForegroundColor Yellow
Write-Host "3. 选择'文本'格式" -ForegroundColor Yellow

Read-Host "按 Enter 退出"


完全白嫖 DeepSeek! 拿去不谢!

http://www.dtcms.com/a/424894.html

相关文章:

  • 网站的差异广州品牌营销服务
  • 网站引导页面制作的四个任务名称跨境电商免费平台有哪些
  • HTML应用指南:利用GET请求获取全国石头科技体验门店位置信息
  • 如何建立公司网站?网络营销的工作岗位
  • Python单元测试
  • Python+Requests实现接口自动化测试实战
  • 做微信首图的网站免费ppt模板下载免费版百度云
  • Linux驱动:设备树、中断(中断子系统)
  • 全球网站建设建站资源
  • 惠州免费网站建设首页页面设计
  • 电商型网站是否是趋势chrome网站开发插件
  • 长治网站公司上海做网站的公司有哪些
  • 哪些网站结构是不合理的广州市建设和水务局网站
  • JAVA中的抽象类和抽象方法
  • 抄袭网站设计网站关键词优化推广
  • 软件下载网站源码上海网站推广哪家好
  • 网站字体标准自己制作网页怎么制作的
  • 企业官方网站管理制度成全视频免费观看在线看电视剧
  • 无锡模板网站设计公司云设计工具
  • 企业做网站要注意些什么问题长沙网站设计工作室
  • 网站建设 关于我们网络编辑的工作内容
  • 免费创建app网站百科网站推广
  • 江苏建设人才网网站wordpress 外贸
  • 做logo好的网站汕头专业的免费建站
  • MySQL InnoDB存储引擎表的逻辑存储结构实现原理详细介绍
  • 【python】条件与循环语法详解
  • C++函数模板详解
  • ros_control 中 hardware_interface 教程
  • 做视频网站教程wordpress页面添加描述
  • 青岛专业设计网站公司怎样做关键词排名优化