기본 콘텐츠로 건너뛰기

5월, 2021의 게시물 표시

Powershell Symbolic Link

참조: https://superuser.com/questions/1307360/how-do-you-create-a-new-symlink-in-windows-10-using-powershell-not-mklink-exe New-Item -ItemType SymbolicLink -Target "원본파일/디렉토리" -Path "심볼릭이름" 예시 New-Item -ItemType SymbolicLink -Target "G:\내 드라이브\Happy" -Path "D:\Happy"

Powershell Array, Map 정리

Powershell에서 Array, Map에 대한 정리. (매번 찾기 귀찮) 참조: Bash Array, Map 정리 Array 참조:  배열에 대해 알고 싶은 모든 것 # 생성 $empty_array = @() $ar = @("haha", "hoho", "baba", "long string haha hoho") # $ar = "hello", "world, "byebye" # 접근 Write-Output "`$ar[0]=$($ar[0])" Write-Output "all as array=$($ar)" # 기본 Write-Output "all as one=$($ar -join ' ')" # 띄어쓰기를 포함하여 문자열로 합치기 Write-Output "all as one=$(-join $ar)" # 띄어쓰기 없이 문자열로 합치기 Write-Output "length=$($ar.Count)" Write-Output "last=$($ar[-1])" # 현재 상황 Write-Output $ar $ar[-1] = "last" Write-Output $ar # 마지막 원소를 지우고 대입한다. $ar[-2] = "whoami" Write-Output $ar # 마지막-1 원소를 지우고 대입한다. # 추가 $ar += @("blar") $ar += @("keke", "123", "456") $ar += @("long long long string", "another long long long string") Write-Output $ar # Powershell은 Array에 대해 삭제를